ãèªãã§æãåºããã®ã§ãç´¹ä»ã§ãã å ã®è¨äºã¨åæ§ã«ä»¥ä¸ã®é¢æ° sum ã«ã¤ãã¦ã function sum(nums, acc = 0) { console.log({ nums, acc }); if (nums.length === 0) return 0; if (nums.length === 1) return nums[0]; return sum(nums.slice(1), acc + nums[0]); } ãã®é¢æ°sumã®å¼æ° (nums 㨠acc) ã®å¼ã³åºããã¨ã®å¤åãè¦ããå ´åã¯ãæè¬ããªã³ããããã°ã debugger ã使ãã®ã¯ä¸è¬çãªãã¯ããã¯ã¨ãã¦ããç¥ããã¦ãã¾ããããã®ãããªé¢æ°å¼ã³åºãæã®å¼æ°ãç¥ãããå ´åã¯monitor(function)ã¨ããé¢æ°ã使ããã¨ã§åæ§ã®å¹æãå¾ããã¨ãåºæ¥ã¾ãã ãã®å ´å㯠monitor(sum)ã¨ããå¾ã«ãé¢
{{#tags}}- {{label}}
{{/tags}}