JavaScript
Result
Run
License
let arr = ['a', 'b', 'c']; let arr2 = [10, 20, 30]; let likeArray = { length: 3, 0: 100, 1: 200, 2: 300 }; let total = arr.concat(arr2); console.log(total); // 평면화 잠금 console.log("[평면화 잠금]"); arr2[Symbol.isConcatSpreadable] = false; total = arr.concat(arr2); console.log(total); console.log("**********************"); total = arr.concat(likeArray); console.log(total); console.log("[평면화 허용]"); likeArray[Symbol.isConcatSpreadable] = true; total = arr.concat(likeArray); console.log(total);
Console
expand_less
License
License
by DevDic
Close