Fork me on github

判断对象数组是否含有某值

1

contains(arr, val) {
      return arr.filter((item)=> { return item.deviceId == val }).length > 0;
    },

 

posted @ 2023-05-16 11:06  我の前端日记  阅读(12)  评论(0编辑  收藏  举报
Copyright © 2021 LinCangHai
Powered by .NET 5.0 on Kubernetes