Calculating Read time in JavaScript