Random number in multiple range

[ad_1]

HI , thanks for your amazing plugin.

Hello, dear @codepeople. Thank you for your amazing plugin! I need your help!

I understand how to make a random number which is between two numbers (1-10):

((Math.floor (Math.random()*10)+1)

But how do I go about generating a random number which falls into multiple ranges?

For example: number can be between 1 to 10 or between 51 to 60

I try this, but it’s not working:

((Math.floor (Math.random()*10)+1)|(Math.floor (Math.random()*10)+51))

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer