CoffeeScriptã®é¢æ°ã¯æ示çã«returnããã¹ã | CreativeStyle æ¬å½ã«é ãã®ããããã確ããã¾ãããã é©å½ã«ã§ã£ã¡ãããã³ã¼ãã§ã f1 = -> for i in [1, 2, 3] for j in [4, 5, 6] i + j f2 = -> for i in [1, 2, 3] for j in [4, 5, 6] i + j return console.time "f1" for i in [1..100000] then f1() console.timeEnd "f1" console.time "f2" for i in [1..100000] then f2() console.timeEnd "f2" å®è¡ãã¦ã¿ã¾ã $ coffee hoge.coffee f1: 105ms f2: 4ms ç´26åéããã¨ãããã¨ããããã¾ãã
{{#tags}}- {{label}}
{{/tags}}