Saturday, May 16, 2015

JavaScript

  1. In javascript to remove last element of array
a). The pop() method removes the last element of an array, and returns
               that element.
   Note: This method changes the length of an array.
               Tip: To remove the first element of an array, use the shift() method.
b.) Use splice(index,howmany)
                arr.splice(-1,1)

No comments:

Post a Comment