In first place, I am convinced that this is a trivial question, but I cannot understand why this is happening and I couldn\'t find an answer anywhere else. I googled my issu
I found another situation that could cause this to happen. I was converting a PHP function to a JS function and I had the following line:
ticks += "," . Math.floor(yyy * intMax);
Changing it to
ticks += "," + Math.floor(yyy * intMax);
solved the problem
Another library on your page is overriding the Math
object. This is one of the reasons that polluting the Global Namespace is frowned upon.
For reference Math
should return the following
Somehow, NotScript got automatically installed in my Chrome browser on Ubuntu 16.04. That inserts the script you show in your update just after the <html>
tag.
I had to go to the settings, look at the extensions, disable the NotScripts and then restart Chrome to it would be gone.
On Ubuntu, this must be very recent or the script got updated recently because I ran the exact same test in Chrome, with the exact same scripts, a few days ago, and it was working just fine.
Interestingly enough, it looks like it was removed 2 years ago (Nov 2014) and maybe re-added recently?
Something overrides Math
in your code.
Execute Math
in your chrome console. Execute context menu on it and select "Show function definition". This will probably lead you to "Sources" panel and show script where it is being overriden.
EDIT: this is chrome extension called notscripts
. Disable it. Here is the source code for proof: webarchive