ES6 - Understand the Differences Between import and require - correct syntax not passing
See original GitHub issuetest not passing
in this challenge, the final “NOTE” provided suggests using “./” if the file containing functions to import it are in the same folder, however the solution using that hint does not pass.
Add a Link to the page with the problem
Tell us about your browser and operating system
- Browser Name: Chrome
- Browser Version: Version 66.0.3359.181 (Official Build) (64-bit)
- Operating System: High Sierra 10.13.4
If possible, add a screenshot here (not a screenshot, but this code does not pass) and it should, and is ‘more correct’ than “string_functions” since many compilers will give an error without the “./”
"use strict";
import { capitalizeString } from "./string_functions"
capitalizeString("hello!");
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Difference between node.js require and ES6 import and export
Require is Non-lexical, it stays where they have put the file. Import is lexical, it gets sorted to the top of the file....
Read more >JavaScript require vs import - Flexiple
One of the major differences between require() and import() is that require() can be called from anywhere inside the program whereas import() ...
Read more >The Huge Difference Between ES6 import and ES5 require in ...
The require syntax is older (pre-2015, meaning before ES6) and isn't commonly used in “modern JavaScript” — for good reason! When you call...
Read more >node.js - The difference between "require(x)" and "import x"
import coming from ES6 is an update to the old CommonJs module where require came from. Down the line, I will differential the...
Read more >JavaScript Import vs. Require: What are the Differences?
Import. Require ; import() works with ES6. require()uses CommonJS ; Lexical – it gets sorted to the top. It is non-lexical – it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
the following statements should pass the test however they do not:
even your suggestion of removing
./
which is incorrect, doesn’t workthe only one which seems to pass the test is with double quotes, … what ?!
+1 Please fix these