Square Every Digit

Published by Mubashir Hassan in

Create a function that squares every digit of a number.

Examples

squareDigits(9119) ➞ 811181

squareDigits(2483) ➞ 416649

squareDigits(3212) ➞ 9414

Notes

The function receives an integer and must return an integer.

Watch a quick demo on how Edabit works.