I need javascript to add 5 to an integer variable, but instead it treats the variable as a string, so it write out the variable, then add 5 onto the end of the "string". How can I force it to do math instead? var dots = document.getElement...

How do I parse and evaluate a mathematical expression in a string (e.g. '1+1') without invoking eval(string) to yield its numerical value? With that example, I want the function to accept '1+1' and return 2....

According to Google Calculator (-13) % 64 is 51. According to Javascript (see this JSBin) it is -13. How do I fix this?...

Why when I use this: (assuming i = 1) divID = "question-" + i+1; I get question-11 and not question-2?...

How i can calculate the date in javascript knowing weeknumber and the year? For week number 20 and year 2013 to obtain 5/16/2013 I am trying so: Date.prototype.dayofYear = function() { var d = new Date(this.getFullYear(), 0, 0);...

I need a log function for JavaScript, but it needs to be base 10. I can't see any listing for this, so I'm assuming it's not possible. Are there any math wizards out there who know a solution for this?...

I just read on MDN that one of the quirks of JS's handling of numbers due to everything being "double-precision 64-bit format IEEE 754 values" is that when you do something like .2 + .1 you get 0.30000000000000004 (that's what the a...

This question already has answers here:...

It is sad to see that science and math is never given enough attention in Android platform. Maybe this is an easy problem, but I'm a total dude in javascript so I'm struggling to understand how to solve this problem. What I want to do is sim...

This question already has answers here:...

©2020 All rights reserved.