javascript - Typescript, NodeJS, ES6 - findIndex on array -
so have issue using findindex es6 function on array in typescript , nodejs.
the error message i'm getting is:
requesttype.findindex not function
this code:
let weatherstates:array<string> = ['current', 'forecast']; let requesttype:string = 'current'; requesttype.findindex(weatherstates);
and error gets thrown, i'm able use sorts of other es6 functionalities though, arrow functions etc.
it looks polyfill available in lib.core.d.ts typing though.
here mytsconfig.json setup:
{ "compileroptions": { "module": "commonjs", "target": "es6", "sourcemap": true }, "exclude": [ "node_modules", "typings" ] }
i'm new typescript appreciated!
requesttype
not array in example. string.
Comments
Post a Comment