Answers for "Welcome. In this kata, you are asked to square every digit of a number.For example, if we run 9119 through the function, 811181 will come out, because 92 is 81 and 12 is 1."

0

if we run 9119 through the function, 811181 will come out, because 92 is 81 and 12 is 1.

function squareDigits(num){
    return Number(('' + num).split('').map(function (val) { return val * val;}).join(''));
}
Posted by: Guest on July-06-2020

Code answers related to "Welcome. In this kata, you are asked to square every digit of a number.For example, if we run 9119 through the function, 811181 will come out, because 92 is 81 and 12 is 1."

Code answers related to "Javascript"

Browse Popular Code Answers by Language