Невозможно использовать оператор Import за пределами модуля из консоли.log
//method of exporting variables, contants and...
export const greetings = "Hi"; //saved as ex1.js
import {greetings} from "[specify path]/JavaScript Exercises/ex1.js"; //saved as mod.js
tinydev