From a9d7a8cf83eec3ada0a6e413d760d6e4f61f6fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Wed, 20 Dec 2017 09:28:53 +0100 Subject: [PATCH] fix curly braces --- README.md | 3 ++- docs/index.html | 3 ++- snippets/isPrime.md | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 39f165be1..715b1a3c9 100644 --- a/README.md +++ b/README.md @@ -1224,9 +1224,10 @@ Checks if the provided integer is a prime number. Returns `false` if the provided number has positive divisors other than 1 and itself or if the number itself is less than 2. ```js -const isPrime = num => +const isPrime = num => { for (var i = 2; i < num; i++) if (num % i == 0) return false; return num >= 2; +} // isPrime(11) -> true // isPrime(12) -> false // isPrime(1) -> false diff --git a/docs/index.html b/docs/index.html index 7648b07e7..d0bd32993 100644 --- a/docs/index.html +++ b/docs/index.html @@ -765,9 +765,10 @@ Returns true if the number is even, false if the numbe

isPrime

Checks if the provided integer is a prime number.

Returns false if the provided number has positive divisors other than 1 and itself or if the number itself is less than 2.

-
const isPrime = num =>
+
const isPrime = num => {
   for (var i = 2; i < num; i++) if (num % i == 0) return false;
   return num >= 2;
+}
 // isPrime(11) -> true
 // isPrime(12) -> false
 // isPrime(1) -> false
diff --git a/snippets/isPrime.md b/snippets/isPrime.md
index b372f057f..cc1f69b14 100644
--- a/snippets/isPrime.md
+++ b/snippets/isPrime.md
@@ -5,9 +5,10 @@ Checks if the provided integer is a prime number.
 Returns `false` if the provided number has positive divisors other than 1 and itself or if the number itself is less than 2.
 
 ```js
-const isPrime = num =>
+const isPrime = num => {
   for (var i = 2; i < num; i++) if (num % i == 0) return false;
   return num >= 2;
+}
 // isPrime(11) -> true
 // isPrime(12) -> false
 // isPrime(1) -> false