当前位置:网站首页>js中的push函数介绍
js中的push函数介绍
2022-06-23 14:24:00 【刘家奕_】
push( )
-该方法可以向数组的末尾添加一个或多个元素,并返回数组的新的长度
-可以将要添加的元素作为方法的参数传递,这样这些元素将会自动添加到数组的末尾
-该方法会将数组新的长度作为返回值返回
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script>
arr = [
[1, 2, 3],
[3, 4, 5],
[5, 6, 7],
];
var result = arr.push([3, 6, 7]);
alert(arr);
console.log("result=" + result);
</script>
</body>
</html>

边栏推荐
猜你喜欢

去 OPPO 面试, 被问麻了。。。

2021-05-08

分布式数据库使用逻辑卷管理存储之扩容
![[deeply understand tcapulusdb technology] tcapulusdb import data](/img/c5/fe0c9333b46c25be15ed4ba42f7bf8.png)
[deeply understand tcapulusdb technology] tcapulusdb import data

In this year's English college entrance examination, CMU delivered 134 high scores with reconstruction pre training, significantly surpassing gpt3

杀入美团、饿了么腹地,京东外卖劲儿有多大?

2021-04-15

信贷产品额度定价场景下的回归模型效果评估

巴比特 | 元宇宙每日必读:Meta、微软等科技巨头成立元宇宙标准论坛组织,华为、阿里加入,英伟达高管称欢迎来自加密世界的参与者...

2021-06-07
随机推荐
Qu'est - ce que ça veut dire? Où dois - je m'inscrire?
打印内存站信息
一款自动生成单元测试的 IDEA 插件
2021-05-08
Error 1079 when starting a service: the account of this service is different from that of other services running on the same process
详解Redis分布式锁的原理与实现
建议自查!MySQL驱动Bug引发的事务不回滚问题,也许你正面临该风险!
RF Analyzer Demo搭建
基因检测,如何帮助患者对抗疾病?
Use of pyqt5 tool box
Selenium Edge的IE模式
Tencent ECS failed to send email
系统设计与分析-技术报告-定时清理验证码的一种解决方案
The first public available pytorch version alphafold2 is reproduced, and Columbia University is open source openfold, with more than 1000 stars
图解OneFlow的学习率调整策略
[deeply understand tcapulusdb technology] tcapulusdb import data
PHP指定字段大于100正序排,小于100随机排
5分钟快速上线Web应用和API(Vercel)
Error creating bean with name xxx Factory method ‘sqlSessionFactory‘ threw exception; nested excepti
【二级等保】过二级等保用哪个堡垒机品牌好?