What is the difference between the two?
So I know that array.size() is a function while array.length is a property. Is there a usecase for
The property 'length' returns the (last_key + 1) for arrays with numeric keys:
var nums = new Array ();
nums [ 10 ] = 10 ;
nums [ 11 ] = 11 ;
log.info( nums.length );
will print 12!
This will work:
var nums = new Array ();
nums [ 10 ] = 10 ;
nums [ 11 ] = 11 ;
nums [ 12 ] = 12 ;
log.info( nums.length + ' / '+ Object.keys(nums).length );