Whats the difference between console.log and return in JavaScript?
they both seen to print out things in terminal.
isPrime(num){
if (num % i === 0)) {
return false ;
}
for (var i = 2; i < num; i++) {
if (num % i === 0) {
return false;
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…