Javascript Function not defined error in code -


i new javascript , don't understand why getting error piece of code. please me understand syntax got wrong.

var iseven = function(number){     if(number % 2 = 0){         return true;     } else {         return false;     }; };  iseven(5); 

change

if(number % 2 = 0) 

to

if(number % 2 === 0) 

because want test if modulo 2 of number has no remainder. wrote illegal assignment operation.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -