通过属性值从对象数组中获取JavaScript对象[重复]
问题: This question already has an answer here: 这个问题已经在这里有了答案: Find object by id in an array of JavaScript objects 32 answers 在JavaScript对象数组中按ID查找对象 32个答案 Let's say I have an array of four objects: 假设我有四个对象组成的数组: var jsObjects = [ {a: 1, b: 2}, {a: 3, b: 4}, {a: 5, b: 6}, {a: 7, b: 8} ]; Is there a way that I can get the third object ( {a: 5, b: 6} ) by the value of the property b for example without a for...in loop? 有没有一种方法可以通过属性 b 的值获取第三个对象( {a: 5, b: 6} ),例如,没有 for...in 循环? 解决方案: 参考一: https://stackoom.com/question/waiJ/通过属性值从对象数组中获取JavaScript对象-重复 参考二: https://oldbug.net/q/waiJ/Get