js判断数组是否包含某个值

1.indexof

array.indexOf();返回正整数或-1

2.includes()

array.includes()返回true,false

3.findeIndex()

array.findeIndex()返回false和数组下标

转载:https://www.cnblogs.com/zaijin-yang/p/12196811.html

array.includes

posted @ 2020-05-07 09:34  绯颜旧雨  阅读(8575)  评论(0编辑  收藏  举报