I\'m creating a table with d3 to be used by the FooTable jquery plugin and this requires having some data- attributes in the header row. But not all columns have all the data a
A cleaner is to use filter
.filter(d => !!d["data-class"]) // filter only data with the "data-class" property .attr("data-class", d => d["data-class"])