Computed Properties similar to Lazy Properties | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Computed Properties similar to Lazy Properties

Are computed properties similar to lazy properties im that they are not computed/found durimg initializiation, rather they are computed later when the computed properties are called? I.e. Is the computed property found during initialization of when its called?

5th May 2017, 2:11 AM
FishermanMan
1 Answer
+ 1
Computed properties are computed every time the property is used; whilst a lazy property is only computed the first time that it is used, after that: the value is just reused. To sum up, a computed value is calculated every time it is referenced whilst a lazy property is computed once, when it is first referenced.
9th Jul 2021, 3:37 PM
Pawel Zabinski
Pawel Zabinski - avatar