Code Snippets

Speed-up jQuery with jString

The JavaScript Way

var casper = require('casper').create();

for ( i=0; i < myArray.length; i++) {
	var val = myArray[i] ;
	// do something
}

 

The jQuery Way

$.each(myArray, funciton(i, val) {
	// do something
});

For more information about JavaScript and jString see our blog post: Speed-up jQuery with jString.

Resource Tags: