js some objects in important ways

Today, when I learn Vue and see the array of methods a lot of JS, but I do not know, I thought it was Vue methods, the results looking for a long data did not find out, and finally found it to be an array of object methods JS, so wanted do some notes, look deeper impression, and then will continue to update ......

Array Object Methods

method description
concat() Connecting two or more arrays, and returns the result.
copyWithin() Another copy of the specified position in the array element of the array to the specified location.
entries() Return iterable array.
every() Whether each element of the detection element values ​​are eligible.
fill() Using the array to fill a fixed value.
filter() Sensed value element, and returns an array of all elements meet the conditions.
find() Returns the array element in line with the incoming test (function) conditions.
findIndex() Returns an array element index in line with the incoming test (function) conditions.
forEach() Each element in the array performs a callback function.
from() Create an array through a given object.
includes() An array comprising determining whether a specified value.
indexOf() Search for elements in the array and returns its location.
isArray() Determine whether an object is an array.
join() All the elements of the array into a string.
keys() Back iterables array, comprising an array of the original key (key).
lastIndexOf() Search elements in the array, and returns the last location it appears.
map() Through each array element specifies the processing function, and returns an array processed.
pop() Delete the last element of the array and returns the removed element.
push() Add one or more elements to the end of the array, and returns the new length.
reduce() The array element is calculated as a value (left to right).
reduceRight() The array element is calculated as a value (right to left).
reverse() Reverse the order of elements in the array.
shift() Removes and returns the first element of the array.
slice() Selecting a portion of the array, and returns a new array.
some() Are there elements that meet the specified condition detection array element.
sort() Of the elements of the array to be sorted.
splice() Add or remove elements from an array.
toString() Converting a string array, and returns the result.
unshift() 向数组的开头添加一个或更多元素,并返回新的长度。
valueOf() 返回数组对象的原始值。

Guess you like

Origin www.cnblogs.com/adongyo/p/11247306.html
Recommended