Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts

Thursday, June 3, 2010

Filtering JavaScript Arrays

Below is an example of how you can filter a JavaScript array using jQuery


var foo = new Array(5);
foo[0] = "zero";
foo[1] = "one";
foo[2] = "two";
foo[3] = "three";
foo[4] = "four";

alert(foo);

fooSelected = jQuery.grep(foo, function(value) {
return value != "three";
} );

alert(fooSelected);

Tuesday, March 30, 2010

JS Bin - Collaborative JavaScript Debugging

Great tool allows you to quickly test out and collaborate javascript development, kind of like pastebin for javascript