so I'm trying to call the function jsonToAim(), which is created in a.js, in another script b.js
this is how I defined it in a.js:
export function jsonToAim(jsonObj){...}
this is how I called it in b.js
const backend = require('./a')`
let aimObj = backend.jsonToAim(jsonObj);
I ended up getting this error:
export function jsonToAim(jsonObj){
^^^^^^
SyntaxError: Unexpected token 'export'
at wrapSafe (internal/modules/cjs/loader.js:992:16)
at Module._compile (internal/modules/cjs/loader.js:1040:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:941:32)
at Function.Module._load (internal/modules/cjs/loader.js:782:14)
at Module.require (internal/modules/cjs/loader.js:965:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/create-aims/getAim.js:4:17)
at Module._compile (internal/modules/cjs/loader.js:1076:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
does anyone know where I went wrong? sorry if this is a stupid question i'm super new to js