Phil Anderson @philanderson888
https://linktr.ee/philanderson888
repositories from which to learn the basics of javascript
see the notes folder
viewable output from this repository may be viewed on my netlify deployment pages
current at 2024
https://mellifluous-rugelach-2383f5.netlify.app/
https://javascript.info/import-export
export const months = ['jan','feb','etc']
function doThis(){}
function doThat(){}
export {doThis,doThat};
import {doThis,doThat} from '/.myFile.js';
doThis()
doThat()
// or
import * as doThings from './myFile.js'
doThings.doThis()
doThings.doThat()
export default
is used for the single item to be exported in a file.
when importing
braces are not required for items which were exported using export default
ie
export default class User {
constructor(name) {
this.name = name;
}
}
import User from './user.js';
const john = new User('John');