JavaScript Reference/Javascript Methods/reverse

Материал из Web эксперт
Перейти к: навигация, поиск

"reverse()" Example

   <source lang="javascript">
   

<html> <body> <button onclick="var myA = new Array(10,11,12); myA.reverse();

                alert(myA);">REVERSE</button>

</body> </html>


     </source>
   
  


"reverse()" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |Array | +----------------+--------------------------------------------------------------+

     </source>
   
  


"reverse()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Reverses the order of the elements in an array.

Syntax:

arrayName.reverse()


     </source>