function random(min, max) {
    //return Math.abs( (max * Math.random()) - (min * Math.random()) );
    return (min + Math.random() * (max - min));
    // return Math.floor (min + Math.random() * (max-min));            // pt randomInteger
}
/*
A random number from min to max
importance: 2

The built-in function Math.random() creates a random value from 0 to 1 (not including 1).

Write the function random(min, max) to generate a random floating-point number from min to max (not including max).

Examples of its work:

alert( random(1, 5) ); // 1.2345623452
alert( random(1, 5) ); // 3.7894332423
alert( random(1, 5) ); // 4.3435234525

***************************************************

A random integer from min to max
importance: 2

Create a function randomInteger(min, max) that generates a random integer number from min to max including both min and max as possible values.

Any number from the interval min..max must appear with the same probability.

Examples of its work:

alert( randomInteger(1, 5) ); // 1
alert( randomInteger(1, 5) ); // 3
alert( randomInteger(1, 5) ); // 5

You can use the solution of the previous task as the base.

*/
A random number from min to max
importance: 2

The built-in function Math.random() creates a random value from 0 to 1 (not including 1).

Write the function random(min, max) to generate a random floating-point number from min to max (not including max).

Examples of its work.





A random integer from min to max
importance: 2

Create a function randomInteger(min, max) that generates a random integer number from min to max including both min and max as possible values.

Any number from the interval min..max must appear with the same probability.

Examples of its work.



You can use the solution of the previous task as the base.
A random number from min to max importance : 2 The built - in function Math . random () creates a random value from 0 to 1 ( not including 1 ) . Write the function random ( min max ) to generate a random floating - point number from min to max ( not including max ) . Examples of its work . A random integer from min to max importance : 2 Create a function randomInteger ( min max ) that generates a random integer number from min to max including both min and max as possible values . Any number from the interval min .. max must appear with the same probability . Examples of its work . You can use the solution of the previous task as the base .
function random(min, max) {
    return (min + Math.random() * (max - min));
}
function random ( min , max ) { return ( min + Math . random ( ) * ( max - min ) ) ; }
A random number from min to max
importance: 2
A random number from min to max importance : 2
//return Math.abs( (max * Math.random()) - (min * Math.random()) ); // return Math.floor (min + Math.random() * (max-min));            // pt randomInteger