JavaScript-Array Object

    技术2022-05-20  38

    Array Object Properties

    PropertyDescriptionconstructorReturns the function that created the Array object's prototypelengthSets or returns the number of elements in an arrayprototypeAllows you to add properties and methods to an object

    Array Object Methods

    MethodDescriptionconcat()Joins two or more arrays, and returns a copy of the joined arraysjoin()Joins all elements of an array into a stringpop()Removes the last element of an array, and returns that elementpush()Adds new elements to the end of an array, and returns the new lengthreverse()Reverses the order of the elements in an arrayshift()Removes the first element of an array, and returns that elementslice()Selects a part of an array, and returns the new arraysort()Sorts the elements of an arraysplice()Adds/Removes elements from an arraytoString()Converts an array to a string, and returns the resultunshift()Adds new elements to the beginning of an array, and returns the new lengthvalueOf()Returns the primitive value of an array


    最新回复(0)