ã¯ããã« ES2019ã®ã¢ãããã¼ãã§é
åã®ã¡ã½ããflatMap()ã追å ããã¾ããã ã¯ããã¦flatMap()ãè¦ãã¨ãã¯ãããã¯ã©ããªã¨ãã«ä½¿ãã®ã ãããã¨æãã¾ããã ç§ã®ããã«flatMap()ããã¤ä½¿ãã®ããã³ã¨æ¥ã¦ããªãæ¹ãå¤ãã¨æãã¾ãã ããã調ã¹ã¦ãããã¡ã«è²ã
使ããäºãããã£ãã®ã§ãflatMap()ã®ä½¿ãã©ããããç´¹ä»ãã¾ãã flat()ã¨ã¯ ã¾ãäºåç¥èã¨ãã¦åããES2019ã§è¿½å ãããflat()ã«ã¤ãã¦èª¬æãã¾ãã flat()ã¯é
åã®ã¡ã½ããã§ãèªèº«ã®é
åã®æ¬¡å
ã1ã¤ä¸ãããã®ãè¿ãã¾ãã const example1 = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ]; example1.flat(); // å®è¡çµæï¼[1, 2, 3, 4, 5, 6, 7, 8, 9] const example2 = [ 1, 2,
{{#tags}}- {{label}}
{{/tags}}