From ad5471a20c2fc1d63b36fbb7dfff70a30d959fe1 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Tue, 12 Jan 2021 19:36:36 +0200 Subject: [PATCH] Update isPrime.md --- snippets/isPrime.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/isPrime.md b/snippets/isPrime.md index 6aa2a231e..7f4b443d0 100644 --- a/snippets/isPrime.md +++ b/snippets/isPrime.md @@ -11,7 +11,7 @@ Checks if the provided integer is a prime number. ```js const isPrime = num => { const boundary = Math.floor(Math.sqrt(num)); - for (var i = 2; i <= boundary; i++) if (num % i === 0) return false; + for (let i = 2; i <= boundary; i++) if (num % i === 0) return false; return num >= 2; }; ```