freeCodeCamp Challenge Guide: Create an Export Fallback with export default

Create an Export Fallback with export default

What’s a fallback value? It’s basically a default that the code will go back to if nothing has been set. For example, variables have the default fallback value of undefined. That being said, a hint for this challenge!


Hints

Hint 1

Just add export default to the beginning of the function.


Solutions

Solution 1 (Click to Show/Hide)
"use strict";
export default function subtract(x, y) {
  return x - y;
}
4 Likes