当前位置:网站首页>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>

边栏推荐
- 2021-06-03
- AXI_ Round_ Robin_ Arbiter design - aw and W channels
- LEGO announces price increase, speculators are more excited
- Simple tutorial of live streaming with OBS
- 2021-06-03
- WPF (c) new open source control library: newbeecoder UI waiting animation
- 一款自动生成单元测试的 IDEA 插件
- golang--文件的多个处理场景
- Google &huggingface| zero sample language model structure with the strongest ability
- Golang -- multiple processing scenarios for files
猜你喜欢

Uniswap acquires genie, an NFT transaction aggregator. Will the NFT transaction market change?

百萬獎金等你來拿,首届中國元宇宙創新應用大賽聯合創業黑馬火熱招募中!

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

AXI_ Round_ Robin_ Arbiter design - aw and W channels

K8s-- deploy stand-alone MySQL and persist it

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

The new version of Alibaba Seata finally solves the idempotence, suspension and empty rollback problems of the TCC mode

MATLAB|时序数据中的稀疏辅助信号去噪和模式识别

How to use note taking software flowus and note for interval repetition? Based on formula template

乐高宣布涨价,炒家更嗨皮了
随机推荐
聚合生态,使能安全运营,华为云安全云脑智护业务安全
期货怎么开户安全吗,期货手续费哪家期货公司比较低,适合散户开户?
去 OPPO 面试, 被问麻了。。。
2021-04-15
图解OneFlow的学习率调整策略
[datahub] LinkedIn datahub learning notes
ts封装请求
信贷产品额度定价场景下的回归模型效果评估
加快 yarn install 的三个简单技巧
SQL注入漏洞(原理篇)
idea查看.class文件 idea查看.class文件夹
Error 1079 when starting a service: the account of this service is different from that of other services running on the same process
Résumé de la méthode de déduction de la force 513 - trouver la valeur du coin inférieur gauche de l'arbre
An idea plug-in for automatically generating unit tests
如何解决 Iterative 半监督训练 在 ASR 训练中难以落地的问题丨RTC Dev Meetup
[in depth understanding of tcapulusdb technology] tcapulusdb construction data
How to make food nutrition label
Idea view View the class file idea Class folder
Pyqt5 工具盒使用
Why is Xiaomi stuck in the chip quagmire?