Modules in javascript | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Modules in javascript

I am coding a Cool Rock, paper, scissors game , and i decided to split my javascript functionality into different modules and import them so that i can keep my code clean, encapsuled and reusable , but here's the bug i cant import these JS files into my main Js file , it keeps printing out errors to the browser console and nothing is working im a bit confused here, Please Your suggestions would really count 🖐🖐

6th Jan 2021, 10:32 PM
Victor Colt
Victor Colt - avatar
1 Answer
+ 1
Have you put type="module" in your script tag? Describe the errors you get
6th Jan 2021, 10:35 PM
Qwerty Uiop
Qwerty Uiop - avatar