---
title: "Discussion on \"js 数组方法\" | Hashnode"
description: "Discussion on \"js 数组方法\". 一、增删改方法\npush()方法接收任意数量的参数，并将它们添加到数组末尾，返回数组的最新长度\nunshift()在数组开头添加任意多个值，然后返回新的数组长度\npop() 方法用于删除数组的最后一项，同时减少数组的 length 值，返回被删除的项\nshift()方法用于删除数组的第一项，同时减少数组的 length 值，返回被删除的项\nsplice功能强大，可以同时对数组进行增删改的操作\n二、搜索和位置方法\nindexOf()返回要查找的元素在数组中第一次出现的下标，如果没找到则返回 -1\n..."
url: "https://hashnode.com/posts/js/652ced004a92fda4b2f1e394"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [js 数组方法](https://zmblog.hashnode.dev/js?utm_source=hashnode&utm_medium=feed)

一、增删改方法 push()方法接收任意数量的参数，并将它们添加到数组末尾，返回数组的最新长度 unshift()在数组开头添加任意多个值，然后返回新的数组长度 pop() 方法用于删除数组的最后一项，同时减少数组的 length 值，返回被删除的项 shift()方法用于删除数组的第一项，同时减少数组的 length 值，返回被删除的项 splice功能强大，可以同时对数组进行增删改的操作 二、搜索和位置方法 indexOf()返回要查找的元素在数组中第一次出现的下标，如果没找到则返回 -1 ...

Oct 16, 2023 · 1 min read · zmblog.hashnode.dev  
Read the article

-   [#array-methods](https://hashnode.com/tag/array-methods)

## Written by

[明](https://hashnode.com/@zm144)

@zm144

  
[View profile](https://hashnode.com/@zm144)

learn

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
