Languages
[Edit]
EN

JavaScript - random short value

7 points
Created by:
Aran-Busby
592

In this short article, we would like to show to randomize short value using JavaScript.

Note: as short value we understand signed 16 bits integer value (from -32768 to 32767).

Quick solution:

 

Reusable function

Edit

 

See also

Edit
  1. JavaScript - random boolean value

  2. JavaScript - random byte value

  3. JavaScript - random int value

  4. JavaScript - random long value

Alternative titles

  1. JavaScript - random Int16 value
  2. JavaScript - random 16 bits signed int value
  3. JavaScript - random <-32768, +32767> value
  4. JavaScript - random sshort value
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join