Https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/es6/use--to-import-everything-from-a-file

Tell us what’s happening:
Hello Guys , this is my code , i don’t know why it’s not passing , i tried every single combinations and im still getting an error , any help’d be so useful , thank you for ur time in advance :smiley:

Your code so far


// add code above this line
"use strict";
import {capitalizeString} from "string_functions";

stringFunctions.uppercaseString("hello");
stringFunctions.lowercaseString("WORLD!");

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36.

Challenge: Use * to Import Everything from a File

Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/es6/use--to-import-everything-from-a-file

Use the import * as syntax

did you?

i guess i did , u can’t see my code ?

you used import something from
look at the example
the topic of this challenge is the * everything selector, which you have not used

u mean
import * as capitalizeString from “string_functions”;

that’s the import * as syntax, but the name of the file you are importing from is wrong
and the name you are using also is wrong
you are not using the required names:

The code in this file requires the contents of the file: string_functions.js , that is in the same directory as the current file. Use the import * as syntax to import everything from the file into an object called stringFunctions.

i dun get it tbh , as i mentioned earlier that i tried every possible combination nd still it dosn’t work , also the task is to use import * as syntax properly , nd that isn’t specified abt names , it’s just not clear enough to me :’(

it is specified, you are told to import in an object called stringFunctions - which is also what is used in other lines of the code

you are told to import from file string_functions.js

you are not using either name

i tried that before , nd still not working
import * as stringFunctions from “string_functions.js”;

look at the example, it may give you an idea

2 Likes