Jump to content

%%%%%%%%%%


Drycodez

Recommended Posts

How does modulos operator works?
it's in the tutorials. have you read about operators yet?http://www.w3schools.com/js/js_operators.aspedit: it's the remainder from doing division (example from the tutorials)
x = 5 % 2; //x = 1

Link to comment
Share on other sites

The modulus operator returns the remainder of a number divided by another.var x = 15%3;15 is divided equally by 3 (15/3 = 5) so the remainder is 0. x is equal to 0.var x = 15%4;15 is not divided equally by 4 (15/4 = 3.75). 4 only goes into 15 three times (4*3 = 12) with a remainder of 3 (15-12 = 3). x is equal to 3.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...