JavaScript Reference/Javascript Methods/concat 2

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

"concat()" Example

   <source lang="javascript">
   

<html> <body> <button onclick="var myS = new String("First String ");

                alert(myS.concat("Another string"));">add two strings together</button>

</body> </html>


     </source>
   
  


"concat()" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |String | +----------------+--------------------------------------------------------------+

     </source>
   
  


"concat()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Merges multiple strings to a new string, which is the return value.

Syntax:

stringName.concat(paramN, . . . ,paramN)

   paramN   Required; a string or String object.
   
     
     </source>