存在一个包含很多对象的数组。需要按属性在此数组中查找一个或多个对象。
输入对象:
var Obj = [
{"start": 0, "length": 3, "style": "text"},
{"start": 4, "length": 2, "style": "operator"},
{"start": 4, "length": 3, "style": "error"}
];
输出结果:(用值 4 搜索“start”)
var result = [
{"start": 4, "length": 2, "style": "operator"},
{"start": 4, "length": 3, "style": "error"}
];