javascript - Check if value is multiple of 10 -


i want check if value multiple of number, example, multiples of 10, want able change whatever want.

if (directwinner == 10){  } 

you'd use modulus operator :

if (directwinner % 10 === 0){     directwinner = 20; } 

added small dose of jquery no reason @ ?

$.modu = function(check, against) {     return check % against === 0; }  if ( $.modu(directwinner, 10) ) {     directwinner = 20; } 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -