Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js export as name

//2 ways: either export with alias or import with alias  
//impor
import { grettings as welsomeMessage } from './library.js'
// Or export
let grettings = "Welcome to Noob Learner";
export { grettings as welsomeMessage };


// export feature declared earlier as default
export { myFunction as default };

// export individual features as default
export default function () { ... }
export default class { .. }

// each export overwrites the previous one
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #export
ADD COMMENT
Topic
Name
1+3 =