js怎么判断上一个的pId是否等于数组中下一个的pId
array.forEach((item, index, array) => {
if (array[index+1] && array[index+1].pId === item.pid) {
console.log('前后的PID相等')
}
})
作者:admin 2021-04-21 我要评论
js怎么判断上一个的pId是否等于数组中下一个的pId ### array.forEach((item, index, array) = { if (array[index+1] array[index+1].pId === item.pid) { consol...
js怎么判断上一个的pId是否等于数组中下一个的pId
array.forEach((item, index, array) => {
if (array[index+1] && array[index+1].pId === item.pid) {
console.log('前后的PID相等')
}
})
版权声明:本文转载自网络,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。本站转载出于传播更多优秀技术知识之目的,如有侵权请联系QQ/微信:153890879删除