250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- CSS
- JavaScript
- evm
- 기준
- error
- typeScript
- REACT
- nextJS
- middleware
- graphQL
- bitcoin
- built in object
- tailwindcss
- Ethereum
- CLASS
- hardhat
- concept
- express.js
- blockchain
- 삶
- Props
- Redux
- solidity
- Interface
- web
- HTML
- node.js
- API
- useState
- SSR
Archives
- Today
- Total
ReasonJun
javascript : ecma 2023 updates 본문
728x90
toReserved / toSorted / toSpliced (copy, no mutate)
const x = [1, 2, 3];
const y = x.toReversed();
y.push(0)
const arr = [1,3,2];
const sorted = arr.toSorted();
console.log(arr); // [1, 3, 2]
console.log(sorted); // [1, 2, 3]
const a = [ "a", "b", "c", "d"]
const newArray = a.toSpliced(1,2) // ['a', 'b']
with
const x = ["a", "b", "c", "x"]
x[3] = "d"
console.log(x) // ["a", "b", "c", "d"]
const x = ["a", "b", "c", "x"]
const z = x.with(3, "d"); => copy
findLast / findLastIndex
const fruit = ["🍎", "🍊", "🍓", "🍉", "🍓"]
fruit.findLast(item => item === "🍓") // "🍓"
fruit.findLastIndex(item => item === "🍓") // 4
https://www.youtube.com/watch?v=e6WV_DXGwSg
728x90
'Frontend > Javasciprt' 카테고리의 다른 글
javascript : event (delegation, event bubbling) (0) | 2023.06.08 |
---|---|
javascript : event ( add, remove, dispatch, custom event) (0) | 2023.06.08 |
javascript : Array methods that do not mutate the original array (0) | 2023.06.08 |
javascript : Array methods that mutate the original array (0) | 2023.06.08 |
javascript : Timer API , scheduling (0) | 2023.06.08 |
Comments