3 ms·
C#: var obj = new { propA = 1 , propB = "meh" }; JavaScript: var obj = { propA: 1 , propB: "meh" }; I admit that's about as close as they get synt
by nxn 15y ago
C#:
var obj = new
{ propA = 1
, propB = "meh"
};
JavaScript:
var obj =
{ propA: 1
, propB: "meh"
};
I admit that's about as close as they get syntactically, but with type inference, higher order functions, and anonymous types they really kind of "feel" similar in some cases. Oh, and C# has optional dynamic typing, so it can ~really~ feel similar if you want.