Closed GoogleCodeExporter closed 8 years ago
the code is written to not overwrite the find function on Array if it already
exists. but you have found that it does overwrite Array.prototype.find? what
other plugins do you use? can you provide a test page on jsfiddle?
Original comment by simon.po...@gmail.com
on 28 Dec 2011 at 11:02
I think it all depends on the type of loop.
http://jsfiddle.net/cHdyd/
When we use this type, we expect one and receive different.
What will be the best solution?
Original comment by taras...@gmail.com
on 28 Dec 2011 at 4:04
cool, thanks - i've changed the function to be internal to jsPlumb.
it's not actually a bug, incidentally - "for-in" is designed to iterate through
the members of some object, not just the indexed members, and is slower than
using the (for var i = 0; i < array.length; ....) syntax. a good defensive
coding practice is to avoid for-in for arrays and only use it for objects whose
properties you want to iterate (IE can trip you up here).
there are quite a few discussions on this topic on StackOverflow, for example:
http://stackoverflow.com/questions/500504/javascript-for-in-with-arrays
..but like i said, i changed it, since i want jsPlumb to be as unobtrusive as
possible.
Original comment by simon.po...@gmail.com
on 28 Dec 2011 at 9:05
Original comment by simon.po...@gmail.com
on 28 Dec 2011 at 9:05
Thanks
Original comment by taras...@gmail.com
on 30 Dec 2011 at 9:50
1.3.4 was released today.
Original comment by simon.po...@gmail.com
on 9 Jan 2012 at 6:59
Original issue reported on code.google.com by
taras...@gmail.com
on 28 Dec 2011 at 10:42