打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
常用的js函数

JavaScript

数组反转: arr内元素[0,1,2] 反转后: [2,1,0]

arr.reverse();

for循环

for (i = 0; i < arr.length; i++) { 
   
 };
arr.forEach(function(value,index,array){
console.log(value);
console.log(index);
console.log(array);
});

判断数组中是否存在某个值

let arr = [
  { num: 1, val: 'ceshi', flag: 'aa' },
  { num: 2, val: 'ceshi2', flag: 'aa2'  }
]
arr.filter(item => item.num===2 );

angularjs

angular.forEach(arr ,function(item,index,array){
        if(item==xx){
        }
 });

vue

微信小程序

uniapp

layui

bootstrap

color ui

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
5个数组Array方法: indexOf、filter、forEach、map、reduce使用实例
JavaScript中数组元素删除的七大方法汇总
JavaScript数组的一些方法、数学对象、定时器
javascript 数组 对象的一些方法记录
数组去重
ES6新增数组的方法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服