# Cross-language random numbers

**URL:** <https://discourse.processing.org/t/cross-language-random-numbers/3474>\
**Category:** Development\
**Created:** [September 11, 2018, 10:10pm UTC](https://discourse.processing.org/t/cross-language-random-numbers/3474 "2018-09-11T22:10:26Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 28, 2021, 12:15pm UTC](https://discourse.processing.org/t/cross-language-random-numbers/3474/21 "2021-10-28T12:15:40Z")

</div>

> [@figle](#):
>
> … but it was actually the **map()** function that doesn’t exists in JS.

Oops, sorry! I’ve failed in spotting that class RandAnywhere was relying on p5::**map()** method: 🙈

> **[reference | p5.js](https://p5js.org/reference/#/p5/map)**
>
> p5.js a JS client-side library for creating graphic and interactive experiences, based on the core principles of Processing.

At least you’ve found some implementation to replace it. 👍

If you’re still interested, here’s the original p5::**map()** code (but yours is much better!): 🤓

> <https://github.com/processing/p5.js/blob/v1.4.0/src/math/calculation.js#L451-L462>

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [October 31, 2021, 9:23pm UTC](https://discourse.processing.org/t/cross-language-random-numbers/3474/22 "2021-10-31T21:23:35Z")

</div>

Thanks for the `map` fix to make it more portable, @figle

[Previous page](https://discourse.processing.org/t/cross-language-random-numbers/3474.md?page=1)
