s
s
spellbook
Search…
filterBy
Filter specific values from array of objects
1
var spells = [{ name : "fire", damage : 5 },{ name : "ice", damage : 4 }, { name : "water", damage : 5 }];
2
sb.filter(spells,{ damage : 5 });
Copied!
1
-> [{ name : "fire", damage : 5 },{ name : "water", damage : 5 }]
Copied!
1
var spells = [{ name : "fire", damage : 5 },{ name : "ice", damage : 4 }, { name : "water", damage : 5 }];
2
sb.filter(spells,{ name : "fire", name : "ice" });
Copied!
1
-> [{ name : "fire", damage : 5 },{ name : "ice", damage : 4 }]
Copied!
Last modified 1yr ago
Copy link