返回对象的函数保持不变。
创建一个新的Array时将用到map函数,保持原始的数组内容不变,实际上大多数函数性程序员都喜欢这种方式。
The map function would be used where a new array was to be created, leaving the original array contents untouched, which is actually the way most functional programmers would prefer to operate.
在这一部分中,我讨论的是函数式编程的基石之一:不变性。
In this installment, I discuss one of the building blocks of functional programming: immutability.
They only depend on the state the system is in.
态函数是不变的,它们只依赖于。
I'm using the fact that when you take a cosine and change the angle inside the cosine, it doesn't care. whereas, if you go to the sine and change the angle inside the sine, it becomes minus sine.
我用了一个结论,当你使用余弦函数时,改变角度的正负,函数值不变,而对于正弦函数,改变角度的符号,则函数值也会变号
应用推荐