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

Adds items to the mangler object.

.push(item[, item...])
Parameter Type Default Description
item Any The item to add to the mangler object. Accepts any number of parameters.

Returns

Returns a reference to the mangler object itself for chaining.


Pushes the item directly to the .items[ ] array. For a mangler object m, m.push(item) is equivalent to m.items.push(item). To unwrap arrays, see the .add() method.

Differences between .add() and .push()

a = ['A', 'B', 'C'];
b = ['D', 'E', 'F'];

m1 = Mangler().add(a, b);
m2 = Mangler().push(a, b);

/*
	m1.items = ['A', 'B', 'C', 'D', 'E', 'F']
	m2.items = [['A', 'B', 'C'], ['D', 'E', 'F']]
*/
⚠️ **GitHub.com Fallback** ⚠️