📌  相关文章
📜  在对象 js 中查找项目 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:24.748000             🧑  作者: Mango

代码示例1
const object1 = {
  a: {val: "aa"},
  b: {val: "bb"},
  c: {val: "cc"}
};

let a = Object.values(object1).find((obj) => {
    return obj.val == "bb"
});
console.log(a)
//Object { val: "bb" }
//Use this for finding an item inside an object.