Lesson 12 of 21 · Components
Modules
A .surfs file is a module. It holds types and functions, and it has no markup. pub makes a declaration available to other files. Everything else is private to the file.Your turn
- In money.surfs, write pub fn withTax(price: Float) -> Float. It returns price * 1.19.
- Import it in App.surf, and show withTax(100.0).
Preview
1 error
The sandbox needs a browser.