0% found this document useful (0 votes)
38 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)
38 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

[email protected]
JS ProLearnings

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

[email protected]
JS ProLearnings

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

[email protected]
JS ProLearnings

Check if an Element exists

includes() method returns true if the


element exists. Otherwise, it returns false.

[email protected]
JS ProLearnings

Index of Element

indexOf() array method returns index of


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

[email protected]
JS ProLearnings

Array iteration

[email protected]
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

[email protected]
ProLearnings

We Hope You
Enjoy this Post!
Give Love

Leave a comment

Share

Save for later

[email protected]

You might also like