1233333333333333333333333
摘要: 柯里化是把接受多个参数的函数变换成接受一个单一参数的函数,并且返回一个新函数,这个新函数能够接受原函数的参数。下面可以通过例子来帮助理解。function adder(num) { return function(x) { return num + x; }}var add5 = adder(5);... 阅读全文
posted @ 2015-06-27 22:31 hghrpg 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Item 24: Use a Variable to Save a Reference toargumentsAn iterator is an object providing sequential access to a collection ofdata. A typical API prov... 阅读全文
posted @ 2015-06-27 15:47 hghrpg 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Item 23: Never Modify the arguments ObjectThe arguments object may look like an array, but sadly it does notalways behave like one. Programmers famil... 阅读全文
posted @ 2015-06-27 15:45 hghrpg 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Item 22: Use arguments to Create Variadic FunctionsItem 21 describes a variadic average function, which can process anarbitrary number of arguments a... 阅读全文
posted @ 2015-06-27 15:00 hghrpg 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Item 21: Use apply to Call Functions with DifferentNumbers of ArgumentsImagine that someone provides us with a function that calculates theaverage of ... 阅读全文
posted @ 2015-06-27 14:30 hghrpg 阅读(136) 评论(0) 推荐(0) 编辑
1233333333333333333333333