Published
Edited
Sep 29, 2018
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function recurseCountCharacters([firstCharacter, ...rest], characterToCountMap = {}) {
const currentCharacterCount = characterToCountMap[firstCharacter] || 0;
const newCharacterToCountMap = {
...characterToCountMap,
[firstCharacter]: currentCharacterCount + 1
};
if (rest.length === 0) {
return newCharacterToCountMap;
}
return recurseCountCharacters(rest, newCharacterToCountMap);
}
Insert cell

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.
Learn more