Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

Is there something in JavaScript similar to @import in CSS that allows you to include a JavaScript file inside another JavaScript file?

1 Answer

0 votes
by (106k points)
After the release of ES6 Module, it becomes very easy to include a JavaScript file in another JavaScript file you can do this by the following way:-

Below is the code that shows how to include A JavaScript file to another one.

export function abc() { 

return "abc";

 }

import { abc } from 'module';

 let val = abc(); 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
2 answers
asked Aug 23, 2019 in Python by Sammy (47.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...