“Sintaks penyebaran Javascript” Kode Jawaban

Operator Spread Javascript

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)

Operator Spread Javascript

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)

Operator Spread Javascript

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)

Sintaks penyebaran Javascript

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

Operator Spread Javascript

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

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

Jawaban yang mirip dengan “Sintaks penyebaran Javascript”

Pertanyaan yang mirip dengan “Sintaks penyebaran Javascript”

Lebih banyak jawaban terkait untuk “Sintaks penyebaran Javascript” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya