Command Palette

Search for a command to run...

Hectal
Phase 12: Modules and Tooling
JavaScript · Exercise 1 of 6Next
Beginner

Import from a module

The import map in the HTML tab defines a module called shop. It has a default export (the shop's name) and a named export withTax(price).

In the module script, write one import line that brings in both. Then show the shop's name in #name and the price of a 500 item with tax in #price, worked out by withTax (it should be 590).

What Check tests

  1. The heading shows the shop's name
  2. The price shows 590
  3. The values come from the module (nothing typed in by hand)
  4. No errors in the console

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.