Random Number javascript

tipjs,random

Random Number javascript

function GetRandomNum(Min,Max)
{
var Range = Max - Min;
var Rand = Math.random();
return(Min + Math.round(Rand * Range));
}
var num = GetRandomNum(10000,999999);
alert(num);

Có thể bạn đã miss một số snippets code

Callback in javascript

Callback in javascript

promise in javascript

promise in javascript

Đếm có bao nhiêu items giống nhau trong một array

reduce javascript. Đếm có bao nhiêu items giống nhau trong một array

Await in a for loop

How to Await in a for loop

Merge Array

How to combine two sorted arrays into one? We can do this easily with the spread operator.