Skip to content

Commit

Permalink
fix/add-tests+note-in-import-lesson
Browse files Browse the repository at this point in the history
  • Loading branch information
moT01 authored and scissorsneedfoodtoo committed Jun 28, 2019
1 parent c133a6f commit 9c1b83d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -30,7 +30,7 @@ The following function should be the fallback value for the module. Please add t
```yml
tests:
- text: Your code should use <code>export</code> fallback.
testString: assert(code.match(/export\s+default\s+function\s+subtract\s*\(\s*x,\s*y\s*\)\s*{/g));
testString: assert(code.match(/export\s+default\s+function(\s+subtract\s*|\s*)\(\s*x,\s*y\s*\)\s*{/g));
```

</section>
Expand Down
Expand Up @@ -12,12 +12,12 @@ In the last challenge, you learned about <code>export default</code> and its use
import add from "./math_functions.js";
```

The syntax differs in one key place. The imported value, <code>add</code>, is not surrounded by curly braces (<code>{}</code>). The primary method of importing a default export is to simply write the value's name after <code>import</code>.
The syntax differs in one key place. The imported value, <code>add</code>, is not surrounded by curly braces (<code>{}</code>). <code>add</code> here is simply a variable name for whatever the default export of the <code>math_functions.js</code> file is. You can use any name here when importing a default.
</section>

## Instructions
<section id='instructions'>
In the following code, import the default export, <code>subtract</code>, from the file <code>math_functions.js</code>, found in the same directory as this file.
In the following code, import the default export from the <code>math_functions.js</code> file, found in the same directory as this file. Give the import the name <code>subtract</code>.
</section>

## Tests
Expand Down

0 comments on commit 9c1b83d

Please sign in to comment.