square root of 1 code example
Example 1: sqrt(-1)
sqrt(-1) returns i
Example 2: square number
const squareNumber = n => {
let number = ''
if(n < 0){
return false
}else if(n >= 0){
let square = Math.sqrt(n)
number = Math.floor(square)
}
return number ** 2 === n
}
console.log(squareNumber(0))