Use * to Import Everything from a File HELP

Use * to Import Everything from a File HELP


Tell us what’s happening:


The code below requires the contents of a file, “capitalize_strings”, found in the same directory as it, imported. Add the appropriate import * statement to the top of the file, using the object provided.

What object provided? I get that import * as myObj from "capitalize_strings" syntax but I can’t figure out the “object provided”.

Your code so far

"use strict";
import * as myObj from "capitalize_strings"

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:


I’m stupid. Turns out myObj works!


No, you are not stupid, the question is not well written.

I still can’t pass the test of this silly question, what is the trick?


OK, I got if finally. the semicolon at the end of the import is mandatory! /_-


Thank you so much! :smiley:


ES6 is full of bugs.




and Now,


simply the error i gone by adding " ; " after import


This question definitely needs re-writing. Using “myObj” worked for me finally. Thanks!


So silly, I made the same mistake¡¡


Simply write:

“use strict”;
import * as whatever from “capitalize_strings”;

The most important thing is not to forget the ; - semicolon at the end of the import statement.


Replacing the single quotes by double quotes did the trick for me.


Question Answer

"use strict";
import * as capitalize_strings from "capitalize_strings"; 


Does anyone know why we have to write the answer as

"use strict";
import * as myObj from "capitalize_strings";

and not:

import * as myObj from "capitalize_strings";
"use strict";

Thanks in advance.


The acceptance tests for this challenge are just overly specific, which caused the problems the OP had. However, "use strict"; does have to be the very first thing before any other statements in a file or a function, so that particular test isn’t wrong.


Thank you @chuckadams for the clarification :slight_smile:


the answer requires you to use " instead of ' someone should update the tests for this