sum()求和是一个非常简单的函数,以前我的写法是这样,我想大部分和我一样刚开始学习JS的同学写出来的也会是这样. function sum() { var total=null; for(var i=0;i<arguments.length;i++){ var cur=Number(arguments[i]); if (!isNaN(cur)){ total+=cur; } } return total; } 看到下面这行,我发现自己的路还有很长很长-- function sum() { re…
原文链接:https://swlaschin.gitbooks.io/fsharpforfunandprofit/content/posts/fvsc-sum-of-squares.html Comparing F# with C#: A simple sumF# PK C#:简单的求和 To see what some real F# code looks like, let's start with a simple problem: "sum the squares from 1 to N…