⏱ 0:02est. 2 min
Chapter 62- Dangerous Aside (Arrays and for ..in)
Notes
Example 1 :
Array.prototype.myCustomFeature = ‘cool';
var arr = [‘John, 'Jane', 'Jim'];
for(var prop in arr){
console.log(prop + ":" + arr[prop]);
}
//OUTPUT For in can read all properties of an array to avoid this always use for loop
0 : John
1 : Jane
2 : Jim
myCustomFeature : cool