ç¶ç¶æ¸¡ãã¹ã¿ã¤ã« (CPS: Continuation-assing style) ä¾ãã°ä»¥ä¸ã¯å¼æ°ã¨ãã¦ä¸ããããæ°ã« 1 ãå ããã ãã®é¢æ°ã¨, ãããå¼ã³åºãããã°ã©ã . function succ(x) { return x + 1; } console.log(succ(2)); // -> 3 CPS ã§ã¯é¢æ°ããã®ç¶ç¶ (callback) ãåãåã, å é¨ã§ãã®ç¶ç¶ãå¼ã³åºã. ä¸ã®ä¾ã¨åããã®ã CPS ã§æ¸ãã¨æ¬¡ã®ããã«ãªã. function succCPS(x, callback) { callback(x + 1); } succCPS(2, x => console.log(x)); // -> 3 ãã®ä¾ã ã¨ã»ã¼ä½ã®å¾ããªãã, JavaScript ã«ãã㦠CPS ã¯, ãã¡ã¤ã«ã®èªã¿è¾¼ã¿ããµã¼ãã¼ã¸ã®ãªã¯ã¨ã¹ãã®éä¿¡, ã¦ã¼ã¶ã¼ã®å ¥åå¾ ã¡ãªã©, éåæ
{{#tags}}- {{label}}
{{/tags}}