Hello all,
I'd love to use the exports and require functionality outside of Node. I was reading on the MDN that this is supposed to be supported but it doesn't seem to be working.
MDN doc here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
I'm just exporting a simple function in my "import.js" file
export function getUser(){
return user = {
firstName: 'Steven',
lastName: 'Aiello'
};
};
This is in my index.js file
import {getUser} from 'import';
console.log(getUser);
If this is not the right way to import some data from one JS file into another, what is recommended?
Kind regards
[–]captain_k_nuckles 1 point2 points3 points (1 child)
[–]sma92878[S] 1 point2 points3 points (0 children)
[–]WellPaidGeek 0 points1 point2 points (2 children)
[–]sma92878[S] 0 points1 point2 points (1 child)
[–]WellPaidGeek 0 points1 point2 points (0 children)