Added QUnits Test and used for loop instead of for..in because the latter can traverse unexpectedly over Array.prototype's enumarable methods