
Basic Array Methods in JS
Basic Array methods in java script are Array length Array to string() Array at() Array join() Array pop() Array push() Array shift() Array unshift() Array is Array() Array delete() Array concat() Array copywithin() Array flat() Array slice() Array splice() Array to spliced() EXPLANATION: 1.Array length It returns a length of an array and also used to set length of array OUTPUT=3 2.Array to string() To string methods is used to join multiple string in array as single string with comma . OUTPUT= Rx100,RE Duke 3.Array at() At is used to returns the indexed element OUTPUT:RE 4.Array join() This method used to join all elements into string OUTPUT=RX100*Re*Duke 5.Array pop() *This method is used to remove last element from array OUTPUT:["Rx100","Re"] 6.Array push () This method used a add a new element at the end in array . OUTPUT=["Rx100","RE","Duke","Jawa"] 7.Array shift() This method removes the first element in array and remains other elements in ordered index OUTPUT=["Re","Duke","jawa"]
Continue reading on Dev.to
Opens in a new tab
