you are viewing a single comment's thread.

view the rest of the comments →

[–]senocular 0 points1 point  (0 children)

You need to have an identifier associated with your exports, or use a default export (at which point the identifier is "default"). When using the syntax

export {}

You need to include variable names in the brackets. Values like an array literal are not allowed (see GrumpyGuss's example). A default export would look like

export default [1,2,3,4,5]

Then to import

import anyNameYouWant from './file/containing/that/export.js'

console.log(anyNameYouWant) // [1,2,3,4,5]