Consuming

Consuming

From there you’ll be able to use lodash in your TypeScript code with no fuss. This works for both modules and global code.

For example, once you’ve npm install-ed your type declarations, you can use imports and write

import * as _ from "lodash";
_.padStart("Hello TypeScript!", 20, " ");

or if you’re not using modules, you can just use the global variable _.

_.padStart("Hello TypeScript!", 20, " ");
doc_TypeScript
2016-10-04 19:25:06
Comments
Leave a Comment

Please login to continue.