Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] Digits Multiplication by nlupton
"use strict";
const digitsMultip = n =>
n.toString()
.split('')
.map(Number)
.reduce( (t,c) => c === 0 ? t : t * c)
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!");
}
Dec. 3, 2018
Comments: