Javascript examples for Object:Reflection
Iterate over all unique pairs of entries in an object
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/*from ww w. j ava 2 s . c om*/ var obj = {a:"A", b:"B", c:"C"}; function foo(a, b) { console.log(a,b); } for(i in obj) { var a = obj[i]; delete obj[i]; for(j in obj) { foo(a, obj[j]); } } }); </script> </head> <body> </body> </html>