[...arr.join("")]
...
[...arr.join("")]
...
function numArr(num) {
return [...new Array(num).keys()].map(el=>`${el+1}`);
}
語法(簡單):
var newArray = 原始陣列.filter(callback[, thisArg])
...
使用Object.defineProperty()
(writable設為false即可)
物件陣列.forEach(function(el){ el.屬性名稱=屬性值; });