diff --git a/generators/javascript/math.js b/generators/javascript/math.js index a0c8cb426..2e3828cac 100644 --- a/generators/javascript/math.js +++ b/generators/javascript/math.js @@ -157,7 +157,7 @@ Blockly.JavaScript['math_number_property'] = function(block) { 'mathIsPrime', ['function ' + Blockly.JavaScript.FUNCTION_NAME_PLACEHOLDER_ + '(n) {', ' // https://en.wikipedia.org/wiki/Primality_test#Naive_methods', - ' if (n === 2 || n === 3) {', + ' if (n == 2 || n == 3) {', ' return true;', ' }', ' // False if n is NaN, negative, is 1, or not whole.', diff --git a/tests/generators/golden/generated.js b/tests/generators/golden/generated.js index 7603b8a6d..01e9bd311 100644 --- a/tests/generators/golden/generated.js +++ b/tests/generators/golden/generated.js @@ -427,7 +427,7 @@ function test_constant() { function mathIsPrime(n) { // https://en.wikipedia.org/wiki/Primality_test#Naive_methods - if (n === 2 || n === 3) { + if (n == 2 || n == 3) { return true; } // False if n is NaN, negative, is 1, or not whole.