1/*Use a for loop to iterate through the array and add each entry into
2the newString variable.*/
3
4let arr = ['L', 'C', '1', '0', '1'];
5let newString = '';
6
7for (i = 0; i < arr.length; i++){
8 newString = newString + arr[i];
9}
10
11console.log(newString);
12console.log(arr);
13
14'LC101'
15['L', 'C', '1', '0', '1']
1/*Use a while loop to add the first element in the array to newString,
2then remove that element from the array.*/
3
4let arr = ['L', 'C', '1', '0', '1'];
5let newString = '';
6
7while (arr.length > 0){
8 newString += arr[0];
9 arr.shift();
10}
11console.log(newString);
12console.log(arr);
13
14'LC101'
15[ ]