Baseline Widely available
TypedArray
ì¸ì¤í´ì¤ì copyWithin()
ë©ìëë ì´ íìí ë°°ì´ì ì¼ë¶ë¥¼ ê°ì íìí ë°°ì´ì ë¤ë¥¸ ì¥ìì ìì ë³µì¬ë¥¼ ìííë©° ë°°ì´ì 길ì´ë¥¼ ìì íì§ ìê³ í´ë¹ ë°°ì´ì ë°íí©ëë¤. ì´ ë©ìëë Array.prototype.copyWithin()
ì ê°ì ìê³ ë¦¬ì¦ì ê°ì§ëë¤.
const uint8 = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);
// Insert position, start position, end position
uint8.copyWithin(3, 1, 3);
console.log(uint8);
// Expected output: Uint8Array [1, 2, 3, 2, 3, 6, 7, 8]
구문
copyWithin(target, start)
copyWithin(target, start, end)
매ê°ë³ì
target
ìíì¤ë¥¼ ë³µì¬í 0 ê¸°ë° ì¸ë±ì¤ë¡, ì ìë¡ ë³í. ì´ë start
ì ìë ììê° ë³µì¬ë ìì¹ì í´ë¹íë©°, start
ê³¼ end
ì¬ì´ì 모ë ììë íì ì¸ë±ì¤ì ë³µì¬ë©ëë¤.
start
ìì ë³µì¬ë¥¼ ììí 0 ê¸°ë° ì¸ë±ì¤ë¡, ì ìë¡ ë³íë©ëë¤.
end
Optional
ìì ë³µì¬ë¥¼ ëë¼ 0 ê¸°ë° ì¸ë±ì¤ë¡, ì ìë¡ ë³íë©ëë¤. copyWithin()
ì end
를 í¬í¨íì§ ìê³ end
ì ê¹ì§ ë³µì¬í©ëë¤. copyWithin()
ë ì¬ê¸°ê¹ì§ ë³µì¬íì§ë§ end
를 í¬í¨íì§ë ììµëë¤.
ìì ë íìí ë°°ì´
ì¤ëªë³´ë¤ ìì¸í ì¤ëª
ì Array.prototype.copyWithin()
ì ì°¸ê³ íì기 ë°ëëë¤. ì´ ë©ìëë ë²ì© ë©ìëê° ìëë©° ì¤ì§ íìí ë°°ì´ ì¸ì¤í´ì¤ììë§ í¸ì¶í ì ììµëë¤.
const buffer = new ArrayBuffer(8);
const uint8 = new Uint8Array(buffer);
uint8.set([1, 2, 3]);
console.log(uint8); // Uint8Array [ 1, 2, 3, 0, 0, 0, 0, 0 ]
uint8.copyWithin(3, 0, 3);
console.log(uint8); // Uint8Array [ 1, 2, 3, 1, 2, 3, 0, 0 ]
ëª
ì¸ì ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4