how to use the isarguments function from the underscore library in typescript

To use the isArguments function from the Underscore Library in TypeScript, you first need to install the Underscore type definition file via a package manager:

npm install --save-dev @types/underscore
41 chars
2 lines

Then in your TypeScript code, you can import the isArguments function from Underscore and use it like this:

index.ts
import * as _ from 'underscore';

function foo() {
  console.log(_.isArguments(arguments));  // true
}

foo(1, 2, 3);
118 chars
8 lines

Note that it's recommended to use type annotations for your function parameters and return types whenever possible.

gistlibby LogSnag