const input = 3;
let isPrime = true;
outer: for(let i = 2; i < input; i++){
for(let j = 2; j < input; j++) {
if((i * j) === input) {
isPrime = false;
console.log(`${input} is Not a prime number`);
break outer;
}
}
}
if(isPrime) {
console.log(`${input} is a prime number`); }
Personally, I think this is not the right way, even though I could've done it in an easier way, I approached the problem like so. I needed some feedback from my seniors, can I get a code review?