Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Old school solution in Clear category for [old] Digits Multiplication by Kolya-YA
"use strict";
function digitsMultip(data) {
var calc = 1
String(data).split('').forEach(n => {
if (n > 0) calc *= n
})
return calc;
}
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!");
}
March 3, 2019