This method is used when you want to join an array into a single string using a separator character, check out the example below:
var num = new Array (3);
num = 10;
num = 20;
num = 30;
What will be printed to the screen from the code shown in the example is “10/20/30”, this way you can create a single string with all the data separated by the character entered.
This method is used to join two or more arrays into one, as shown below:
var Text1= new Array (“1″, “2″, “3″);
var Text2 = new Array (“4″, “5″, “6″);
var uni = Texto1.concat(Texto2);
he result to be displayed on the screen will be “1,2,3,4,5,6”.
The practical use of each of these methods will vary according to the logic that will be applied, so well understand how they work can help solve a problem eminent.