Skip to content

philanderson888/javascript

Repository files navigation

Javascript

Contents

author

Phil Anderson @philanderson888

https://linktr.ee/philanderson888

introduction

repositories from which to learn the basics of javascript

resources

official documentation

docs

javascript.info

related topics

nodejs

jQuery

react

typescript

libraries

notes

see the notes folder

viewable output from this repository

viewable output from this repository may be viewed on my netlify deployment pages

current at 2024

https://mellifluous-rugelach-2383f5.netlify.app/

javascript a to z

import and export

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');

About

A learning repository for Javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published