我想敲我的腦袋來過濾下面寫的JSON來獲得所需的結果。如何使用lodash.js或underscore.js過濾json?
[{
"Key": "EShSOKthupE=",
"ImageUrl": "path",
"Title": "ABC",
"CityId": 16,
"TimezoneShortName": "PYT",
"UtcHrsDiff": 8.5,
"PlaceKey": "QIZHdWOa77o=",
"PlaceName": "Shymala Hills Slums",
"Lat": 23.2424856,
"Long": 77.39488289999997,
"ActivityList": [ "Test Activity" ]
},
{
"Key": "NXLQpZAZT4M=",
"ImageUrl": "",
"Title": "ASAS",
"CityId": 17,
"TimezoneShortName": "AEST",
"UtcHrsDiff": 10,
"PlaceKey": "o4fAkahBzYY=",
"PlaceName": "ASAS",
"Lat": 12.9856503,
"Long": 77.60569269999996,
"ActivityList": [ "Adventure Sport" ]
}]
現在我想從上面的json獲得像這樣的json,使用lodash或者requirejore js。
[{
"PlaceKey": "QIZHdWOa77o=",
"PlaceName": "ABC",
"Lat": 23.2424856,
"Long": 77.39488289999997
},
{
"PlaceKey": "o4fAkahBzYY=",
"PlaceName": "ASAS",
"Lat": 12.9856503,
"Long": 77.60569269999996,
}]
我可以得到這個幫助嗎?
我已經使用過濾器_.filter來得到這個但donno exaclty如何得到我提到的結果。 –
我不明白爲什麼這個問題被標記爲否定的? –