-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
数组函数 #43
Comments
2. sliceslice的意思是切片。
|
3. shift/unshift/push/popshift:从集合中把第一个元素删除,并返回这个元素的值。
unshift: 在集合开头添加一个或更多元素,并返回新的长度
push:在集合中添加元素,并返回新的长度
pop:从集合中把最后一个元素删除,并返回这个元素的值。
|
reduce
|
indexof只适合基本数据类型
|
findIndex
|
find
|
some和everysome:有一个符合则遍历结束 every:有一个不符合则遍历结束
|
sort
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1. splice
splice的意思是 粘接。
它是数组的函数。
它的作用是操作数组(增删改)
参数是(index,howmany,item1,item2,...);返回值是被删除的项目。
注意: splice会操作当前array.
The text was updated successfully, but these errors were encountered: