Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 928 Bytes

File metadata and controls

18 lines (11 loc) · 928 Bytes

Jump to Task Overview

Task 3: Computed Property

Alright, awesome! If you did the previous tasks you now know about reactivity.

Next we will look at the 'computed' property. It's a property that updates automatically when a dependency changes. That is different to methods as they are called when something happens as in event handling for example. Computed properties are written like methods but don't accept input arguments. They depend on other properties and are used to output something that depends on something else.

Much text but very simple - trust.

Go to Task 3

TODO 3.1: transform this variable into a computed property

Use computed() to compute changes on number so that every time number changes, the squared variable is automatically updated.

📝 Note: Check out the on-click below! We do not use a function but inline JavaScript for incrementing!