码迷,mamicode.com
首页 > 编程语言 > 详细

判断数组中有该元素?

时间:2018-11-13 03:01:58      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:div   ==   led   dex   clu   his   index   col   include   

方法一:

this.abledNum2.indexOf(num) !== -1

方法二:

this.abledNum2.includes(num)

 

判断数组中有该元素?

标签:div   ==   led   dex   clu   his   index   col   include   

原文地址:https://www.cnblogs.com/candy-Yao/p/9949699.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!