Using Array functions on a non-Array object JavaScript

by Mohan 2012-09-20 23:34:20


Using Array functions on a non-Array object
JavaScript 1.7
var obj = {};
Array.push(obj, 'foo');
Array.push(obj, 123);
Array.push(obj, 5.55);
Print( obj.toSource() ); // prints: ({0:"foo", length:3, 1:123, 2:5.55})
________________________________________



373
like
0
dislike
0
mail
flag

You must LOGIN to add comments