Javascript examples for Object:Object Context
Object context change and eval
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from ww w . j ava2 s.c o m var myObject = { property1: 20, property2: 5000 }; console.log(myObject.property1); with(myObject){ console.log( property1 ); console.log( eval('property1+property2') ); } } </script> </head> <body> </body> </html>