当前位置:网站首页>JS divides an array into groups of three
JS divides an array into groups of three
2022-07-02 06:50:00 【xuefankang】
var data = [
{name:'xue',age:'20'},
{name:'bing',age:'21'},
{name:'hu',age:'22'},
{name:'wang',age:'23'},
{name:'li',age:'24'},
{name:'wan',age:'25'},
{name:'kang',age:'25'},
{name:'hua',age:'26'},
{name:'kai',age:'27'},
{name:'fang',age:'28'},
]
var result = [];
for(var i=0;i<data.length;i+=3){
result.push(data.slice(i,i+3));
}边栏推荐
- ZZQ的博客目录--更新于20210601
- apt命令报证书错误 Certificate verification failed: The certificate is NOT trusted
- Latest CUDA environment configuration (win10 + CUDA 11.6 + vs2019)
- Latex compiles Chinese in vscode and solves the problem of using Chinese path
- js的防抖和节流
- 2020-9-23 use of QT timer qtimer class.
- qq邮箱接收不到jenkins构建后使用email extension 发送的邮件(timestamp 或 auth.......)
- Overload global and member new/delete
- PIP install
- Virtualenv and pipenv installation
猜你喜欢

A preliminary study on ant group G6

Sentry construction and use

The win10 network icon disappears, and the network icon turns gray. Open the network and set the flash back to solve the problem

20201002 VS 2019 QT5.14 开发的程序打包

Latex error: the font size command \normalsize is not defined problem solved

Apt command reports certificate error certificate verification failed: the certificate is not trusted

Explanation and application of annotation and reflection

js中map和forEach的用法

ctf三计

VSCODE 安装LATEX环境,参数配置,常见问题解决
随机推荐
Stress test modification solution
flex九宫格布局
Storage space modifier in CUDA
由于不正常断电导致的unexpected inconsistency;RUN fsck MANUALLY问题已解决
sprintf_s的使用方法
Functions of tensorrt
Overload global and member new/delete
CUDA and Direct3D consistency
virtualenv和pipenv安装
查询GPU时无进程运行,但是显存却被占用了
Latex error: the font size command \normalsize is not defined problem solved
Fe - use of weex development weex UI components and configuration use
pytest(1) 用例收集规则
Promise中有resolve和无resolve的代码执行顺序
js中map和forEach的用法
Nodejs - Express middleware modification header: typeerror [err_invalid_char]: invalid character in header content
Summary of advertisement business bug replay
The intern left a big hole when he ran away and made two online problems, which made me miserable
The table component specifies the concatenation parallel method
pytest(3)parametrize参数化