FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Modern JS: import and export
NewsMachine Learning

Modern JS: import and export

via Dev.toKenta Takeuchi11h ago

This article was originally published on bmf-tech.com . ※This article is a reprint from the Innovator Japan Engineers’ Blog . What is export export is a statement that allows you to receive functions, variables, objects, classes (classes are syntactic sugar for prototype-based inheritance and are a type of function. For more details, see Modern JS: Classes ), etc., from a specified file and use them in any file. There are mainly two ways to use export. Named exports This method involves naming the elements you want to export . export { fooFunction }; export { fooFunction , barFunction , ... }; export const foo = ' bar ' ; export let foo , bar , ...; export class foo {...}; You can export elements like this. You can also use var and let for exporting variables. Default exports This method uses the default keyword to export when you want to set a default element to export. export default fooFunction () {} export default class {} Note that var , let , and const cannot be used with export

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles

News

Gothub is live

Lobsters • 11h ago

I Built the Tool I Wish I Had When I Started My Open Source Journey
News

I Built the Tool I Wish I Had When I Started My Open Source Journey

Medium Programming • 11h ago

Razer Boomslang 20th Anniversary Mouse Review: For Collectors
News

Razer Boomslang 20th Anniversary Mouse Review: For Collectors

Wired • 11h ago

How Bug Bounty Hunters Prioritize 10,000 Recon Targets (Without Losing Their Mind)
News

How Bug Bounty Hunters Prioritize 10,000 Recon Targets (Without Losing Their Mind)

Medium Programming • 11h ago

Microsoft Hasn’t Had a Coherent GUI Strategy Since Petzold
News

Microsoft Hasn’t Had a Coherent GUI Strategy Since Petzold

Lobsters • 12h ago

Discover More Articles