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')
人生到处知何似,应似飞鸿踏雪泥。
原文地址:https://www.cnblogs.com/lepanyou/p/15702072.html