Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Beggining Zeros solution in Uncategorized category for Beginning Zeros by Elena_Korljukova
import assert from "assert";
var beginningZeros = text => Number(text) == 0 ? text.length : text.length - Number(text).toString().length
console.log('Example:');
console.log(beginningZeros('100'));
// These "asserts" are used for self-checking
assert.equal(beginningZeros('100'), 0);
assert.equal(beginningZeros('001'), 2);
assert.equal(beginningZeros('100100'), 0);
assert.equal(beginningZeros('001001'), 2);
assert.equal(beginningZeros('012345679'), 1);
assert.equal(beginningZeros('0000'), 4);
console.log("Coding complete? Click 'Check' to earn cool rewards!");
June 8, 2020