JavaScript's Modulo
Introduction
Hey what's up people since I signed up here, I would like to share this kinda tip about a mathematic this called "modulo". Which is the remainder of division using the % symbol, known as the modulus operator.
Example
And it could be used in the following function for example:
Use the
var isOdd = function (n) {
if (n % 2 === 0) {
return false;
} else {
return true;
}
};
.
Written by Bilal Ketab
Related protips
2 Responses
Add your response
Add your response
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#