I am using lodash in my angular2 app. by using `declare var _: any;` i am doing lodash operation such as `_.findIndex(...)` . Now i am facing one issue. sometimes while loading page i am getting error as below

```
EXCEPTION: ReferenceError: _ is not defined

```

how to avoid this?
As my assumption, lodash code is executed before `declare var _: any;`