returnmd`Okay, so the values in that set are: “${[...a]}”. Just to remind you, they are “${[...a]}”. Wait, what? I just tried the same thing - \`[...a]\` - twice, and the second time it returned nothing. That's because Set#values returns an iterator over the values in a set that can only iterate over them once.`;
returnmd`Okay, so the entries in that object are: “${[...entries]}”. Just to remind you, they are “${[...entries]}”.`;
}
isPureIterable(objectEntries({a:1,b:2}))
functionpureObjectEntries(obj){
return{
[Symbol.iterator]:function*(){
for(constpropKeyofReflect.ownKeys(obj)){
yield[propKey,obj[propKey]];
}
}
};
}
{
letentries=pureObjectEntries({a:1,b:2})
returnmd`Okay, so the entries in that object are: “${[...entries]}”. Just to remind you, they are “${[...entries]}”.`;
}
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.