“JavaScript Spread Syntax” Code-Antworten

JavaScript Spread Operator

var num = [2, 4, 6, 8, 10];
console.log(...num)
//expected output: 2 4 6 8 10
console.log(88, ...num, 99)
// added extra new elements before and after the spread operator
//expected output: 88 2 4 6 8 10 99
Ariful Islam Adil(Code Lover)

JavaScript Spread Operator

var num = [2, 4, 6, 8, 10];
console.log(...num)
//expected output: 2 4 6 8 10
console.log(88, ...num, 99)
//expected output: 88 2 4 6 8 10 99
Ariful Islam Adil(Code Lover)

JavaScript Spread Operator

var num = [2, 4, 6, 8, 10];
console.log(...num)
//expected output: 2 4 6 8 10
console.log(88, ...num, 99) 
// added extra new elements before and after the spread operator
//expected output: 88 2 4 6 8 10 99
Ariful Islam Adil(Code Lover)

JavaScript Spread Syntax

let arr1 = ['one', 'two'];
let arr2 = [...arr1, 'three', 'four', 'five'];
console.log(arr2); // ["one", "two", "three", "four", "five"]
SAMER SAEID

JavaScript Spread Operator

const arrValue = ['My', 'name', 'is', 'Jack'];

console.log(arrValue);   // ["My", "name", "is", "Jack"]
console.log(...arrValue); // My name is Jack
SAMER SAEID

Ähnliche Antworten wie “JavaScript Spread Syntax”

Fragen ähnlich wie “JavaScript Spread Syntax”

Weitere verwandte Antworten zu “JavaScript Spread Syntax” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen