Closed jlopezr closed 10 years ago
why would you want to pass a function?
I am not passing a function. I add some functions to the prototype of the Array, for example:
Array.prototype.getUnique = function() { var o = {}, a = [], i, e; for (i = 0; e = this[i]; i++) {o[e] = 1}; for (e in o) {a.push (e)}; return a; }
When you iterate over the elements of an array using a for-in, you get the "getUnique" element...
2014-03-20 16:04 GMT+01:00 Prabir Shrestha notifications@github.com:
why would you want to pass a function?
Reply to this email directly or view it on GitHubhttps://github.com/Thuzi/facebook-node-sdk/pull/51#issuecomment-38177722 .
The best way to iterate on enumerable properties of arrays is for (var i=0, l=myStringArray.length; i<l; i++) { ... }
. Although the present PR would work, I've opened this one https://github.com/Thuzi/facebook-node-sdk/pull/57
This can be closed since my request was merged in.
If you put some function into the Array prototype the current code fails. This change simply skips the functions when traversing the body Array.