Skip to content Skip to sidebar Skip to footer

Import And Export Javascript

I am writing some Javascript code. I created a js file which contain my exports. However, when I import it into the other js file, I get an error which says SyntaxError: Cannot use

Solution 1:

use require instead of import

const someImported =require('fileName.js')

Post a Comment for "Import And Export Javascript"