...element,// retain old values using spread syntax
date:newDate(element.date.substring(0,10)),// update date to hold a Date object
covidRatio:element.covid/element.total,// add a new field covidRatio that is the ratio of covid news to total news
})
);
aq.from(
data.map(
(element)=>({
...element,
// add your new key value pair here
})
)).view();
ratioOverHalf=data.filter((element)=>{
returnelement.covidRatio>0.5
});
aq.from(
data.filter((element)=>{
// add your code here when you run the code it will show up
})).view();
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.