jQuery next() vs + (plus)
JavaScript performance comparison
Info
I answer this question on Stack Overflow (http://stackoverflow.com/q/6497039/80111) and recommended the .next() function, however someone else recommended the + plus operator (is that the right term), just checking performance of each.
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="abc">
<p></p>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
.next() |
|
pending… |
+ |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Ben Everard
- Revision 2: published by Ben Everard
0 comments