enumerate properties/methods of JavaScript objects added at runtime? - Javascript Object

Javascript examples for Object:Object Property

Description

enumerate properties/methods of JavaScript objects added at runtime?

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=( function() {/*  w w  w .ja v  a 2 s  .  co m*/
function convolutedAPI() {
    window.a = "hi";
}
window.my = [];
for (var key in window) window.my.push(key);

convolutedAPI();

for (var key in window) {
    if (window.my.indexOf(key)==-1) 
       console.log(key, window[key]);
}
    });

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials