Javascript examples for Object:Object Property
Adding a property to every object property of an object
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from w w w .jav a 2 s. c o m function Bar(width) { this.foobar = function() {}; this.width = width } Foo = { bar1: new Bar('10m'), bar2: new Bar('20m'), bar3: new Bar() } console.log(Foo) } </script> </head> <body> </body> </html>