Published
Edited
Dec 9, 2021
10 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
wordCount = text.split(/\s+/g).filter(w => w).length
Insert cell
characterCount = [...text.trim()].length
Insert cell
readTime = wordCount / 265
Insert cell
speakTime = wordCount / 130
Insert cell
formatTime(readTime)
Insert cell
function formatTime(minutes) {
if (minutes < 1) {
const seconds = Math.ceil(minutes * 60);
return `${seconds} second`;
}
minutes = Math.ceil(minutes);
return `${minutes} minute`;
}
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