Remap or Map function in Javascript

Of late, most of my programming experience has been in Processing, and more recently I have been wanting to branch out a little deeper in to some JavaScript, since they are slightly related.

I was just wondering, as my recent searching has turned up nothing, if JavaScript had a similar function to Processing's "map" function, in which a value and it's range is taken and remapped to a new range?

More info here: http://processing.org/reference/map_.html

PS: Yes, I also know that www.processingjs.org exists, but I was just wondering if JS had such a function natively.

17
задан Benjamin 8 January 2014 в 12:41
поделиться