I think my solution is right I mean algorithm but this isn't rendered by node.js my console just stop (My Goal: want to calculate positive whole numbers root square without using javascript own functions)
THIS IS MY CODE:
function squareRoot(number){
if(number<0 || false === Number.isInteger(number)){
return 'PLEASE ENTER POSITVE WHOLE NUMBER!!!'
}else{
let container=0;
for(let root=0; container<number;root=root+0.1 ){
if(number===root*root){
return root;
}else{}
}
}
};
console.log(squareRoot(9));