KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I must be missing something here, because Math.prototype is undefined for me . Why is this? I tried to do something like this: Math.prototype.randomRange = function(from, to){ return Math.floor(Math.random() * (to - from + 1) + from); } But instead had to do something like this: Math.randomRange = function(from, to){ return Math.floor(Math.random() * (to - from + 1) + from); } That doesn't feel right, though. Is it just me or should I be doing this another way? I apologize if this is a silly or duplicate question, but I couldn't find anything by searching (exactly two questions turn up when I search SO for "Math.prototype", which is kind of weird).
Tags (comma-separated)
Save Edits
Cancel