Array.join() : Join : Array JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Array » Join »

 

Array.join()










Syntax








array.join()
    array.join(string)



The join() method converts all the elements to strings and then concatenates all the strings into a longer string.

If an argument is provided in the parameter list, it is used to separate the elements in the string returned by the method.












<html>
    <script language="JavaScript">
    <!--
    fruit = new Array("A","B","C");
    aString = fruit.join("-");  
    document.write("The fruit array contains: ",aString);
    -->
    </script>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Array
» Join