RecipesChapter 1: Project Setup

Loading Types from Definitely Typed

Recipe 1.5 from The TypeScript Cookbook

// If `@types/lodash` is installed, we get proper 
// type defintions for this NPM package
import _ from "lodash"

const result = _.flattenDeep([1, [2, [3, [4]], 5]]);
Open in TypeScript Playground →