Baseline 2024
Newly available
difference()
㯠Set
ã¤ã³ã¹ã¿ã³ã¹ã®ã¡ã½ããã§ãéåãä¸ã¤åãåãããã® Set ã«å«ã¾ãã¦ãããä¸ããããéåã«å«ã¾ããªãè¦ç´ ãå«ãæ°ãã Set ãè¿ãã¾ãã
æ°ãã Set
ãªãã¸ã§ã¯ãã§ããã® Set ã«å«ã¾ããè¦ç´ ã§ãother
éåã«ã¯å«ã¾ããªãè¦ç´ ãå
¥ã£ããã®ã§ãã
æ°å¦çãªè¨æ³ã§ã¯ãå·® (difference) ã¯æ¬¡ã®ããã«å®ç¾©ããã¾ãã
A â B = { x â A ⣠x â B } A\setminus B = \{x\in A\mid x\notin B\}ãã³å³ã使ãã¨ãããªãã¾ãã
difference()
ã¯ãSet 風ãªãã¸ã§ã¯ãã other
弿°ã¨ãã¦åãå
¥ãã¾ããthis
ã¯ãã¦ã¼ã¶ã¼ã³ã¼ããå¼ã³åºããã¨ãªããthis
ãªãã¸ã§ã¯ãã«æ ¼ç´ããã¦ãããã¼ã¿ã«ç´æ¥ã¢ã¯ã»ã¹ãããããå®éã® Set
ã¤ã³ã¹ã¿ã³ã¹ã§ãããã¨ãè¦æ±ããã¾ãããã®å¾ããã®åä½ã¯ this
㨠other
ã®ãµã¤ãºã«ä¾åãã¾ãã
this
ã®ä¸ã®è¦ç´ ã other.size
ãããå¤ãã£ãå ´åãother
ã keys()
ã¡ã½ãããå¼ã³åºããã¨ã§èµ°æ»ããthis
ã®ä¸ã®ãã¹ã¦ã®è¦ç´ ã®ãã¡ other
ã«ãªãè¦ç´ ã§æ°ãã Set ãæ§ç¯ãã¾ããthis
ã®è¦ç´ ãèµ°æ»ããthis
ã®è¦ç´ e
ã®ãã¡ãother.has(e)
ãå½å¤ãè¿ããã¹ã¦ãå«ãæ°ãã Set ãæ§ç¯ãã¾ããè¿ããã Set ã®è¦ç´ ã®é åºã¯ãthis
ã®é åºã¨åãã§ãã
次ã®ä¾ã§ã¯ã奿°ï¼10 æªæºï¼ã¨å®å ¨å¹³æ¹ï¼10 æªæºï¼ã®éåã®å·®ãè¨ç®ãã¾ããçµæã¯ãå®å ¨å¹³æ¹ã§ã¯ãªã奿°ã®éåã¨ãªãã¾ãã
const odds = new Set([1, 3, 5, 7, 9]);
const squares = new Set([1, 4, 9]);
console.log(odds.difference(squares)); // Set(3) { 3, 5, 7 }
仿§æ¸ ãã©ã¦ã¶ã¼ã®äºææ§ é¢é£æ
å ±
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