Javascript examples for Object:Object Literal
Set key and from variable in one line
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w. j a v a 2s. co m*/ function myFunction(opts){ console.log(opts); } var options = {} , key = "foo", value = "bar" ; myFunction(new function(){this[key]=value;}); } </script> </head> <body> </body> </html>