for a simple function such as
function foo(hash)
{
for(var k in hash){
if (h.hasOwnProperty(k)){
console.log('Key is: ' + k + ', value is: ' + h[k]);
}
}
}
if you passing an argument like
var m = new Object();
m['one'] = 1;
foo(m);
you will see the result on your console, but if you pass an argument like
foo(({} ['one'] =1));
or
foo((new Object()['one'] = 1));
it will no go through the for-loop, the expression
(new Object()['one'] = 1) == m
returns false while,
(new Object()['one'] = 1) == ({} ['one'] = 1)
return true
any ideas why not? Thanks!!!