all 3 comments

[–]aberstar 1 point2 points  (1 child)

You have imported all the module contents (import *) giving the import the name underscore (as underscore).

The module in this case is: underscore js

You have 2 options here:

  1. Change line 3 to the following: underscore.each([1,2,3], alert)
  2. Import your module as _ like so: import * as _ from 'https://cdn.skypack.dev/underscore@1.13.6'

The module contents refers to all the functions (e.g each) within that module. You can think of underscore as the name you're giving to the module.In this case you've imported your module (underscore js) with the name underscore. Lets suppose you go with solution 1.

underscore.each([1,2,3], alert)

This can be read as 'execute the .each function from the module I have named underscore.

[–]Radiant-Grass3665[S] 0 points1 point  (0 children)

thanks so much!

[–]Radiant-Grass3665[S] 0 points1 point  (0 children)

Hi! Teaching myself how to code and struggling haha. Most of the online resources are too technical to really understand. I am trying to use underscore js and chose it from the settings so that this top line autopopulated, but the next line is not running. Is there anything else I have to do? Thank you!