Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for [old] Digits Multiplication by Sim0000
"use strict";
function digitsMultip(data) {
prod = 1
for(d of String(data).split("")){
if(d != 0) prod *= d
}
return prod
}
var assert = require('assert');
if (!global.is_checking) {
assert.equal(digitsMultip(123405), 120, "1st");
assert.equal(digitsMultip(999), 729, "2nd");
assert.equal(digitsMultip(1000), 1, "3rd");
assert.equal(digitsMultip(1111), 1, "4th");
console.log("Coding complete? Click 'Check' to review your tests and earn cool rewards!");
}
July 7, 2016
Comments: