Pls I need assistance, am practicing on importing module but my code is not working. I have tried all I could to know where the problem is from but no way.
I keep getting this error:
script2.js:1
Uncaught SyntaxError: Invalid or unexpected token (at script2.js:1:1)
there is the snippet
import { addToCart } from './minScript.js';
addToCart('bread', 5);
// Below is from the minScript.js. NB both are in the same directory
export const addToCart = function (product, quantity) {
cart.push({ product, quantity });
console.log(`${product}, ${quantity} was added to cart`);
};
pls I really need help am just a beginner