I’m going to research on this and get back here. Basically, I’m wondering the following:
Why am I able to test inside of a function for arguments.length. But I can create an object literal and length is undefined? example:
[pastacode lang=”javascript” message=”” highlight=”” provider=”manual”]
function count(a,b) {
console.log(arguments.length); // 2
}
count(1,2);
var obj = { a: 1, b : 2 };
console.log(obj.length); // undefined!
[/pastacode]