consider this test http://jsperf.com/query-wrappers
Does anyone have an idea why is “jq wrapper (single)” test 3xs faster than the “direct call single” test? (Chrome results)
It make no sense to me – I’ve tried replacing this.i with value 0 in “single” class and results don’t change much.
The only way I see it is if the Browser has some kind of enhancing system for these cases…
I literally can’t wrap my head around it 😀
Your code is strange:
That’s never going to do anything useful. You initialize the “length” property to zero, so the subsequent loop won’t do anything at all.
Other places in the code seem to assume that “length” will be managed automatically. That, however, is only true for Array instances, which your objects cannot be.