Sorry this is a very small segment of code:
var arr = [2,4,6,8];
var obj = {};
for (var i in arr) {
obj[arr[i]] = arr[i] * 2;
}
What I expect it to do is output the values of arr
in an object, and return those values doubled. My does that but also includes this:
'function () {\r\n var result = [];\r\n for (var property in this)\r\n result.push(property);\r\n return result;\r\n}': NaN
Can anyone explain to me why this happens? Thank you.