Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/timrogers/array.each.js

A really quick Javascript helper file for adding an "each" method to arrays
https://github.com/timrogers/array.each.js

Last synced: 13 days ago
JSON representation

A really quick Javascript helper file for adding an "each" method to arrays

Awesome Lists containing this project

README

        

Array.each.js
=============

A really quick Javascript helper file that adds an each() method to array's, allowing you to loop through them without any extra complications of making your own _for_ loops. Simple but effective.

It's really easy to put into your page - you can get it straight from GitHub:



And then it's really easy to use as well!

var fruits = ["bananas", "oranges", "pears"];
fruits.each(function(item) {
alert("I like " + item + "!");
});

---

__Created by Tim Rogers. Use this however you like, I don't mind.__