I was going through the Javascript map function, and stuck at the loop syntax. It is difficult to figure out the o placed after comma. Can anybody help me figure it out. Also what is the terminating condition for loop ?
Array.prototype.mymap = function (callback) {
var obj = Object(this);
if (obj.length === 0) return null;
if (typeof(callback) === 'undefined') return null;
for (var i = 0, o; o = obj[i]; i++) {
obj[i] = callback(o);
}
return obj;
};
o