literal creation like this: js.Dynamic.literal("name1" -> "value", "name2" -> "value")
literal creation like this: js.Dynamic.literal("name1" -> "value", "name2" -> "value")
Note that this could be simply def apply
, but this would make the
applyDynamicNamed fail, since a call with named arguments would
be routed to the def apply
, rather than def dynamic version.
literal creation like this: js.Dynamic.literal(name1 = "value", name2 = "value")
Creates a new object with a literal syntax.
For example, js.Dynamic.literal(foo = 3, bar = "foobar") returns the JavaScript object {foo: 3, bar: "foobar"}