Baseline 2024
Newly available
Set
å®ä¾ç union()
æ¹æ³æ¥åä¸ä¸ªéåå¹¶è¿åå
å«å½åéåä¸ç»å®éåä¸åå¨çææå
ç´ çæ°éåã
ä¸ä¸ªæ°ç Set
对象ï¼å
å«å½åéåä¸ other
ä¸åå¨çææå
ç´ ã
ä½¿ç¨æ°å¦è®°å·ï¼å¹¶éçå®ä¹å¦ä¸ï¼
A ⪠B = { x ⣠x â A or x â B } A\cup B = {x\midx\in A\text{ or }x\in B}使ç¨ç»´æ©å¾è¡¨ç¤ºï¼
union()
æ¥åç±»éå对象ä½ä¸º other
åæ°ãæ¹æ³è¦æ± this
æ¯ä¸ä¸ª Set
çå®ä¾ï¼å 为å®ä¸è°ç¨ä»»ä½ç¨æ·ä»£ç èç´æ¥è·å this
ä¸åå¨çæ°æ®ãç¶åï¼å®éè¿è°ç¨ other
ç keys()
æ¹æ³è¿ä»£ other
ï¼å¹¶æé ä¸ä¸ªæ°çéåãè¿ä¸ªéåé¦å
å
å«æææ¥èª this
çå
ç´ ï¼ç¶åæ¯ææå¨ other
éä½ä¸å¨ this
éçå
ç´ ã
è¿åçéåéçå
ç´ ç顺åºé¦å
æ¯ this
ä¸çå
ç´ ï¼å
¶æ¬¡æ¯ other
ä¸çå
ç´ ã
ä¸é¢ç代ç å±ç¤ºäºå¦ä½å¾å°å°äº 10 çå¶æ°éåå°äº 10 çå®å ¨å¹³æ¹æ°éçå¹¶éãè¿åçå¹¶éå ¶ä¸çå ç´ æ¯å¶æ°æè æ¯å®å ¨å¹³æ¹æ°ã
const evens = new Set([2, 4, 6, 8]);
const squares = new Set([1, 4, 9]);
console.log(evens.union(squares)); // Set(6) { 2, 4, 6, 8, 1, 9 }
è§è æµè§å¨å
¼å®¹æ§ åè§
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