CSE 154 Examples

String Representation of Arrays

Description :

In Javascript, we can get the string representation of an Array by using the toString method. The toString method gives us a string with the array elements separated by a comma.

Syntax : let string_representation = original_array.toString();

Examples :

						 
               let arr = ["Roger", "Patrick", "Teresa"];
               let stringRep = arr.toString();
						 
               replaced =  ?? 
           
						 
               let arr = [1.3, 4.5, 6.5];
               let stringRep = arr.toString();
					   
               replaced =  ??