concat Function:
Joins two arrays and returns a new array.
Syntax:
concat(arrayName2,arrayName3, ...,arrayNameN);
Example in HEAD section:
<html> <head> <title>Concat Function</title> <script language="javascript"> var s1="Oh " var s2="what a beautiful " var s3="morning" var s4=s1.concat(s2,s3) document.write(s4); </script> </head> </html> |
Example in BODY section:
<html> <head> <title>Concat Function</title> </head> <body> <script language="javascript"> var s1="Oh " var s2="what a beautiful " var s3="morning" var s4=s1.concat(s2,s3) document.write(s4); </script> </body> </html> |
OUTPUT
Oh what a beautiful morning
No comments:
Post a Comment