The immediate value code in the alert array _javascript tips

Source: Internet
Author: User

JS Code

* 
* Then the value of the alert 
array * A indicates that the arrays 
/function Alert1 (a) 
{ 
var alength = a.length; 
if (Alength > 1) 
{ 
var r = random1 (0,alength); 
Alert (A[r]); 
A[R] =-1; 
var temp = Array (alength-1); 
var t = false; 
for (var i = 0; i<a.length; i++) 
{ 
if (i = = r) { 
T = true; 
} 
else{ 
if (t = = False) { 
Temp[i] = A[i]; 
} else{ 
temp[i-1] = A[i]; 
} 
} 
Alert1 (temp); 
} 
else 
{ 
alert (a[0]); 
} 

JS Code

* * * The 
value between min (included) and Max (not included)/ 
function random1 (min, max) {return 
Math.floor (min + ( Math.random ()% (max-min))); 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.