Importando do módulo padrão de exportação

/*test.js*/
let x = "XXXXXX"
export default x;

/*index.ejs*/

import Y from '/javascripts/test.js'
window.onload = function(){
console.log(Y);

}

/*With export default we have no restrictions in the name we import the variable as. We also leave out the {}*/
Javasper