This week's book giveaway is in the Testing forum.
We're giving away four copies of Practical Unit Testing with TestNG and Mockito and have Tomek Kaczanowski on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Mod function in JS? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Mod function in JS?" Watch "Mod function in JS?" New topic
Author

Mod function in JS?

auvrm papu
Ranch Hand

Joined: Sep 01, 2005
Posts: 102
is there a mod function in JS?

like 10 % 2
or 10 mod 2
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50680

Did you try it?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
auvrm papu
Ranch Hand

Joined: Sep 01, 2005
Posts: 102
thanks Bear..

I did try..before..and got an error..so I just wanted to verify...
(just figured out that I had some other issues ...in the paranthesis..! )
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50680

You probably could have saved yourself some time by posting your code and the error that you were getting. You should also think about getting yourself a good JavaScript reference to answer these types of questions for you quickly.
 
IntelliJ Java IDE
 
subject: Mod function in JS?
 
Threads others viewed
Dan's Test Q on %
Printing output of loop
Trying to look at only at the number in the "ones" digit place
Change Increment index of for loop in stored procedure
javascript import
developer file tools