CSE 154 Examples

The Join Function

Description :

In Javascript, we can get join multiple entries in an array into a single string using the join function. The join funciton also lets us specify the delimiter to separate different elements in the string.

Syntax : let string_representation = original_array.join(separator);

Examples :

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