First, you need to install the Underscore library and type definitions via npm:
index.ts71 chars3 lines
In your Typescript file, import Underscore and the shuffle function:
index.ts176 chars6 lines
Make sure to include the type definitions in your tsconfig.json file:
79 chars9 lines
You can also specify the types directly in your Typescript file:
index.ts189 chars6 lines
With this, you can now use the shuffle function from the Underscore library in your Typescript project.
gistlibby LogSnag