Javascript examples for Object:Object Property
Define a property based on another property
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/* ww w.ja va2s .c o m*/ var someNameSpace = (function(){ var x1 = 100; return { x1: x1, x2: x1 * 0.5 }; })(); console.log(someNameSpace) }); </script> </head> <body> </body> </html>