.each() - DarthJDG/Mangler.js GitHub Wiki

Iterates through all items of the mangler object.

.each(callback)
Parameter Type Default Description
callback Function Function to call for each item. Parameters: function(i, item), where i is the index in the **[[.items[ ]

Returns

Returns a reference to the mangler object itself for chaining.


If the callback function returns false, the iteration will stop:

Mangler(['A', 'B', 'C', 'D', 'E']).each(function(i, item) {
	console.log(i + ': ' + item);

	if(item === 'C') return false;
});

/*
	Output:

	0: A
	1: B
	2: C
*/
⚠️ **GitHub.com Fallback** ⚠️