indexOf 与 includes

indexOf与includes的区别 - 知乎 (zhihu.com)

ES5 indexOf returnValue Integer (if it exists, return its position index, else return -1)

ES6 includes returnValue Boolean

exp.判断对象中是否含有以autoCalculateIDs为键值的值:

Object.keys(row).includes('autoCalculateIDs')
posted @ 2021-12-17 14:06  乐盘游  阅读(30)  评论(0编辑  收藏  举报