JavaScript Tutorial/Array/Concat

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

Actual success in copying an array using concat()

   <source lang="javascript">

<html> <head> <title>Actual success in copying an array using concat()</title> <script type="text/javascript" language="javascript">

</script> </head> <body onload="CopyArray()"> </body> </html></source>


Array.concat()

Syntax array.concat(arg1,...argN)

The concat() method adds the elements listed in the parameter list to the end of the existing array and returns the result.

arg1,...argN contains one or more elements to be concatenated to the end of the array.

The original is not changed by this method.



   <source lang="javascript">

<html>

   <script language="JavaScript">
   </script>
   </html></source>
   
  

Using concat() method to combine two arrays

   <source lang="javascript">

<html> <head> <title>Using concat() method to combine two arrays</title> <script type="text/javascript" language="javascript">

</script> </head> <body onload="ConcatArrays()"> </body> </html></source>