当前位置:网站首页>js把一个数组分割成每三个一组
js把一个数组分割成每三个一组
2022-07-02 06:23: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));
}
边栏推荐
- selenium备忘录:selenium\webdriver\remote\remote_connection.py:374: ResourceWarning: unclosed<xxxx>解决办法
- Latex compiles Chinese in vscode and solves the problem of using Chinese path
- Kotlin - 验证时间格式是否是 yyyy-MM-dd HH:mm:ss
- Selenium+msedgedriver+edge browser installation driver pit
- DeprecationWarning: .ix is deprecated. Please use.loc for label based indexing or.iloc for positi
- Fe - use of weex development weex UI components and configuration use
- Alibaba cloud MFA binding Chrome browser
- kali最新更新指南
- There are multiple good constructors and room will problem
- [self cultivation of programmers] - Reflection on job hunting Part II
猜你喜欢
pytest(1) 用例收集规则
uniapp引入本地字体
js中map和forEach的用法
ctf-web之练习赛
Uploading attachments using Win32 in Web Automation
Utilisation de la carte et de foreach dans JS
由於不正常斷電導致的unexpected inconsistency;RUN fsck MANUALLY問題已解决
js中map和forEach的用法
Latex 报错 LaTeX Error: The font size command \normalsize is not defined问题解决
AWD learning
随机推荐
看完有用的blog
Vector types and variables built in CUDA
VSCODE 安装LATEX环境,参数配置,常见问题解决
Flask migrate cannot detect db String() equal length change
web自动化切换窗口时报错“list“ object is not callable
Blog directory of zzq -- updated on 20210601
Latex compiles Chinese in vscode and solves the problem of using Chinese path
Win10桌面图标没有办法拖动(可以选中可以打开可以删除新建等操作但是不能拖动)
PIP install
Eggjs -typeorm treeenity practice
由于不正常断电导致的unexpected inconsistency;RUN fsck MANUALLY问题已解决
js中map和forEach的用法
Utilisation de la carte et de foreach dans JS
Warp shuffle in CUDA
Deployment API_ automation_ Problems encountered during test
AWD学习
Android - Kotlin 下使用 Room 遇到 There are multiple good constructors and Room will ... 问题
Sublime Text 配置php编译环境
FE - Eggjs 结合 Typeorm 出现连接不了数据库
部署api_automation_test过程中遇到的问题