0% found this document useful (0 votes)
51 views

JS Array CheatSheet

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

JS Array CheatSheet

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

ProLearnings

JS Array
CheatSheet

zeeshanhashmi1998@gmail.com
JS ProLearnings

Add an Element
unshift() and push() array methods help
to add an element at the start and end
of the array respectively.

zeeshanhashmi1998@gmail.com
JS ProLearnings

Remove Elements
shift() and pop() array methods help to
remove an element at the start and end of
the array respectively.

zeeshanhashmi1998@gmail.com
JS ProLearnings

Check if an Element exists

includes() method returns true if the


element exists. Otherwise, it returns false.

zeeshanhashmi1998@gmail.com
JS ProLearnings

Index of Element

indexOf() array method returns index of


the element if it exists. Otherwise, it
returns -1.

zeeshanhashmi1998@gmail.com
JS ProLearnings

Array iteration

zeeshanhashmi1998@gmail.com
JS ProLearnings

Find Element in Array


indexOf() returns the index of the element
but with find() method, we can search for
elemopts based on different conditions

zeeshanhashmi1998@gmail.com
ProLearnings

We Hope You
Enjoy this Post!
Give Love

Leave a comment

Share

Save for later

zeeshanhashmi1998@gmail.com

You might also like