function squareDigits(num){
//first change the number to string
let strnum = String(num)
let result = ''
//Do search of the String (number)
for(let i =0; i<strnum.length;i++){
//For math we need change it again to int
let squared = parseInt(strnum[i])*parseInt(strnum[i])
//and after that change again to string
result = result+ String(squared)
}
// The final change to int
return parseInt(result)
}
console.log(squareDigits(9119))