Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
NumLength - SLR - toString(), length; solution in Clear category for Number Length by Taylor_Page
import assert from "assert";
function numberLength(value: number): number {
return value.toString().length
}
console.log('Example:');
console.log(numberLength(10));
// These "asserts" are used for self-checking
assert.equal(numberLength(10), 2);
assert.equal(numberLength(0), 1);
assert.equal(numberLength(4), 1);
assert.equal(numberLength(44), 2);
console.log("Coding complete? Click 'Check' to earn cool rewards!");
April 23, 2020
Comments: