from array to string code example
Example 1: js array to string
var myArray = ['no','u'];
var myString = myArray.toString();
Example 2: javascript convert in a string the items of an array
const arr = [1, 2, 'a', '1a'];
const str = arr.toString();
console.log(str);
Example 3: array to string javascript
var cars = ["Volvo", "BMW", "Audi", "Chevrolet"];
console.log(cars.toString());
Example 4: transform array to string js
const myArray = [1, 2, 3, 4, 5, 6];
console.log(a.join('/'));
const myArray = ['g', 'o', 'o', 'g', 'l', 'e'];
console.log(a.join(''));
const array1 = [1, 2, 'a', '1a'];
console.log(array1.toString());
Example 5: java string array to one string
public class ArrayOfStrings {
public static void main(String args[]) {
String stringArray[] = {"Hello ", " how", " are", " you", " welcome", " to", " Tutorialspoint"};
StringBuffer sb = new StringBuffer();
for(int i = 0; i < stringArray.length; i++) {
sb.append(stringArray[i]);
}
String str = sb.toString();
System.out.println(str);
}
}
Example 6: how to print a array js
var array = [1,2,3]
for(var i = 0; i < array.length ; i++){
console.log(array[i])
}