user3821345 user3821345 - 9 months ago 23
Javascript Question

Selecting multiple properties in Javascript or D3

I'm trying to remove a few data points from a map created in D3.

Here I'm removing a property with name matching "Luxembourg", but I would also like to remove a property with name matching "Liechtenstein". How should I write this?

.filter(function(labels) {
return != "Luxembourg";

I have tried using javascript references but I'm having trouble applying these.


How about using Array.prototype.indexOf

.filter(function(labels) {             
   var toFilter = ['Luxembourg', 'Liechtenstein']
   return toFilter.indexOf( !== -1