Skip to content

Commit e8d0b69

Browse files
committed
se crea funcion isPrime
1 parent e7bbcd9 commit e8d0b69

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

isPrime.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const isPrime = (num) => {
2+
if(num < 2) return false;
3+
4+
for(let i=2; i<num; i++){
5+
if(num % i === 0) return false
6+
}
7+
return true
8+
}

0 commit comments

Comments
 (0)