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

Lấy tháng hiện tại trong javascript

Lấy tháng hiện tại trong javascript

How to reverse an Array?

Reversing an array in JS is really simple with the standard array method. Like below

So sánh hai array trong javascript

Làm thế nào để đánh giá xem hai mảng có bằng nhau không? Có hai cách đó là sử dụng JSON.stringify() hoặc toString()

Random String

Random String với độ dài tuỳ chọn

Getting the last element of a split string array

Getting the last element of a split string array