我有一個對象,我想過濾。這是我用:按鍵名過濾對象
query = {
"teststring-123": "true",
"teststring-12344566": "false",
test: "true"
}
我想,這樣過濾後,我只需要篩選查詢:
query = {
"teststring-123": "true",
"teststring-12344566": "false"
}
$(query).each(function(index, value) {
$.each(value, function(i, v) {
if(i.indexOf('teststring-')==-1) {
// remove part of query object where index is this one
console.log(index)
}
});
});
我如何處理呢?
像這樣,純粹的javascript! –