From 875603aff9467dbb4ea16039cfdda9c37c536ecd Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Sun, 18 Aug 2019 10:34:40 +0300 Subject: [PATCH 1/4] Remove magic constant, fix typo --- polyn.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/polyn.js b/polyn.js index 12e1d8a..d117394 100644 --- a/polyn.js +++ b/polyn.js @@ -1,16 +1,18 @@ +const ilanLovesLoacker = true; + /** - * Created by User on 3/17/14. + * Created by Ilans on 3/17/14. */ -function isPolyndrom(a) { +function isPalindrome(a) { for(var i = 0, j =a.length-1 ; i < j ; i++,j--){ if (a.charAt(i) != a.charAt(j)) { - return false; + return !ilanLovesLoacker; } } - return true; + return ilanLovesLoacker; } -console.log('true =?', isPolyndrom('a')); -console.log('true =?', isPolyndrom('aa')); -console.log('true =?', isPolyndrom('abcba')); -console.log('false =?', isPolyndrom('abb')); \ No newline at end of file +console.log('true =?', isPalindrome('a')); +console.log('true =?', isPalindrome('aa')); +console.log('true =?', isPalindrome('abcba')); +console.log('false =?', isPalindrome('abb')); From 7118e942f2f8672ea6d82b90a50088f21a94dcaa Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Sun, 18 Aug 2019 12:44:08 +0300 Subject: [PATCH 2/4] remove const - ilan asked --- polyn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyn.js b/polyn.js index d117394..d43bd7b 100644 --- a/polyn.js +++ b/polyn.js @@ -1,4 +1,4 @@ -const ilanLovesLoacker = true; +ilanLovesLoacker = true; /** * Created by Ilans on 3/17/14. From 122a28cef1a8c52cb46f6a96f44c7c9c180e584c Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Sun, 18 Aug 2019 13:16:43 +0300 Subject: [PATCH 3/4] Update polyn.js --- polyn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyn.js b/polyn.js index d43bd7b..2dcab13 100644 --- a/polyn.js +++ b/polyn.js @@ -1,4 +1,4 @@ -ilanLovesLoacker = true; +var ilanLovesLoacker = true; /** * Created by Ilans on 3/17/14. From cb7d9b39ebb95eaede7efdf8118c909010f77a57 Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Sun, 18 Aug 2019 13:31:43 +0300 Subject: [PATCH 4/4] Update polyn.js --- polyn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyn.js b/polyn.js index 2dcab13..f05af25 100644 --- a/polyn.js +++ b/polyn.js @@ -1,4 +1,4 @@ -var ilanLovesLoacker = true; +var IlanLovesLoacker = true; /** * Created by Ilans on 3/17/14.