我有一个如下数组
var goal = [
{
"category" : "education",
"title" : "Charlie University",
"description" : "Lorem ipsum dolor sit amet",
"date" : "01/03/2020",
"value" : 50000,
"achievability" : 3,
"experimental_achievability": 3,
"designation": "{"id":1, "jobCode":1003}",
"suggested": false,
"accounts": [],
"articles": [],
"related_goals": [],
"id":"1"
},
{
"category" : "education",
"title" : "Charlie University",
"description" : "Lorem ipsum dolor sit amet",
"date" : "01/03/2020",
"value" : 50000,
"achievability" : 3,
"experimental_achievability": 3,
"designation": "{"id":2, "jobCode":1004}",
"suggested": false,
"accounts": [],
"articles": [],
"related_goals": [],
"id":"2"
},
]
如何"designation": "{"id":2, "jobCode":1004}",使用下划线 JS 从目标数组中获取具有属性的对象。
我可以为此使用 _.findWhere 吗?
汪汪一只猫
相关分类