We would like to know how to reverse an array.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
<!--from w w w. jav a2s . co m-->
var array = [0, 1, 2];
document.writeln(array.reverse().join(','));
</script>
</head>
<body>
</body>
</html>
The code above is rendered as follows: