数组篇 1.compact,就是将数组中的false值去掉 function compact(array) { var index = -1, length = array ? array.length : 0, resIndex = -1, result = []; while (++index < length) { //while循环还是比较好的 var value = array[index]; if (value) { result[++resIndex] = value; } } r
1.capitalize : _.capitalize([string='']) Capitalizes the first character of string. 参数 [string=''] (string): The string to capitalize. 返回值 (string): Returns the capitalized string. 例子 _.capitalize('fred'); // => 'Fred' 今天看到了capitalize用法才知道lodash,以后要加
This lesson shows how to refactor your old loops into using a simpler and more powerful lodash-style. We will start by looking at how many people traditionally write JavaScript for loops and then talk about the alternate style and benefits that Lodas
One of the most confusing parts of getting started with TypeScript is figuring out how to use all the libraries that you know and love from JavaScript. This lesson walks you through including Lodash in your project, installing Lodash definition files