JavaScript Array Methods

This Repository contains all the major array methods for Javascript. Do Star it and Contributions are welcomed.

Find

[3,4,5,6].at(1); //4

Pop

[3,4,5,6].pop(); //[3,4,5]

Push

[3,4,5,6].push(7); //[3,4,5,6,7]

Fill

[3,4,5,6].fill(1); //[1,1,1,1]

Join

[3,4,5,6].join("-"); // '3-4-5-6'

Shift

[3,4,5,6].shift(); // [4,5,6]

Reverse

[3,4,5,6].reverse(); // [6,5,4,3]

Unshift

[3,4,5,6].unshift(1); //[1,3,4,5,6]

Includes

[3,4,5,6].includes(5); //true

Map

[3,4,5,6].map((num) => num + 6); // [9,10,11,12]

Find

[3,4,5,6].find((num) => num > 4); // 5

Filter

[3,4,5,6].filter((num) => num > 4); // [5,6]

Every

[3,4,5,6].every((num) => num > 5); //false

Find Index

[3,4,5,6].findIndex((num) => num > 4); //2

Reduce

[3,4,5,6].reduce((acc, num) => acc + num,0) //18

Contributing

Pull requests are welcome. Want to add any other Methods, welcomed

Please make sure to update tests as appropriate.

License

MIT