Spreads Operators with Arrays

Run Settings
LanguageJavaScript
Language Version
Run Command
//String to array all kind of transformation to arrays can be performed by isong Spread Operators with arrays const arrayOne=['Maria','Anna','Alex']; const arrayTwo=['Said','Ismail','Aisha']; //extract the values from both the arrays //concating two arrays const concatArray=[...arrayOne,...arrayTwo]; concatArray.forEach(function(name){console.log(name);}); const name='Marain'; const nameToArray=[...name]; nameToArray.forEach(function(letter){console.log(letter);}) const addNumber= function(n1,n2,n3){return n1+n2+n3;} const numbers=[1,5,6,7,4,21,3]; console.log(addNumber(numbers[0],numbers[1],numbers[2])); const addition=addNumber(...numbers); console.log(addition);
Editor Settings
Theme
Key bindings
Full width
Lines