当前位置:网站首页>JS中的pop()元素
JS中的pop()元素
2022-06-23 14:24:00 【刘家奕_】
pop()
-该方法可以删除数组的最后一个元素,并将被删除的元素作为返回值返回
<!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],
];
arr.pop();
alert(arr);
</script>
</body>
</html>

返回值:
<!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.pop();
alert(arr);
console.log("result=" + result);
</script>
</body>
</html>

边栏推荐
- [in depth understanding of tcapulusdb technology] tcapulusdb construction data
- After nine years at the helm, the founding CEO of Allen Institute retired with honor! He predicted that Chinese AI would lead the world
- ICML 2022 𞓜 context integrated transformer based auction design neural network
- 用OBS做直播推流简易教程
- 腾讯云服务器发送邮件失败
- 2021-06-07
- [compréhension approfondie de la technologie tcaplusdb] données de construction tcaplusdb
- MySQL create and manage tables
- Error creating bean with name xxx Factory method ‘sqlSessionFactory‘ threw exception; nested excepti
- MySQL 创建和管理表
猜你喜欢

2021-06-07

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

Un million de bonus vous attend, le premier concours d'innovation et d'application de la Chine Yuan cosmique Joint Venture Black Horse Hot Recruitment!

How to use note taking software flowus and note for interval repetition? Based on formula template
![[datahub] LinkedIn datahub learning notes](/img/ca/9c4a87d38155edd093cbb81d81ee81.png)
[datahub] LinkedIn datahub learning notes

Uniswap 收购 NFT交易聚合器 Genie,NFT 交易市场将生变局?
![[in depth understanding of tcapulusdb technology] tcapulusdb business data backup](/img/1a/449b123c0f2046217ec60af36344eb.png)
[in depth understanding of tcapulusdb technology] tcapulusdb business data backup

Helm 基础入门 Helm介绍与安装

Effect evaluation of regression model under credit product quota pricing scenario

港股今年最大IPO来了,660亿身家,坐在矿山上的“大王”
随机推荐
SQL注入漏洞(原理篇)
go语言的变量声明
JSR303数据校验
AXI_ Round_ Robin_ Arbiter design - aw and W channels
Millions of bonuses are waiting for you to get. The first China Yuan universe innovation and application competition is in hot Recruitment!
Short talk about community: how to build a game community?
港股今年最大IPO来了,660亿身家,坐在矿山上的“大王”
【云驻共创】制造业企业如何建设“条码工厂”
[Level 2 warranty] which brand of Fortress machine is good for Level 2 warranty?
2021-05-22
信贷产品额度定价场景下的回归模型效果评估
2021-05-08
阿里 Seata 新版本终于解决了 TCC 模式的幂等、悬挂和空回滚问题
[datahub] LinkedIn datahub learning notes
MATLAB|时序数据中的稀疏辅助信号去噪和模式识别
快速排序的简单理解
How does activity implement lifecycleowner?
基因检测,如何帮助患者对抗疾病?
2021-06-03
山东:美食“隐藏款”,消费“扫地僧”