JavaScriptã§é
åãæå®ãããåæ°ãã¤ã«åå²ãã¾ãã ä¾ãã°ã [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] ã¨ããé
åã3åãã¤åå²ããã®ã§ããã°ã [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]] ã¨ããé
åã«ãªãã¾ãã å®è£
æ¹é é
åããä¸é¨ãéãåºãã®ã«ã¯ã Array.prototype.slice() - JavaScript | MDN ã¨ããé¢æ°ã使ãã¾ãã ãã®é¢æ°ã¯ãéå§ã®ã¤ã³ããã¯ã¹ã¨çµããã®ã¤ã³ããã¯ã¹ã渡ãã¨ãéå§ã®ã¤ã³ããã¯ã¹ããçµããã®ã¤ã³ããã¯ã¹ã®1ã¤åã¾ã§ã®é¨åã®é
åãè¿ãã¾ãã pythonã®mylist[begin:end]ãrubyã®array[begin...end]ã®ãããªåä½ããã¾ãã ä¾ãã°ã const array=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] ã§ãã
{{#tags}}- {{label}}
{{/tags}}