JavaScript getters can have side effects
Reading a property may execute a getter rather than simply retrieve stored data. Keep getters predictable and avoid relying on them inside serialization or validation loops.
- @imsa-mehta▲ 5
Appreciate the write-up on "JavaScript getters can have side effects". Useful for anyone using javascript / objects.
Good to see "JavaScript getters can have side effects" written down. Handy reference for anyone working with javascript / objects.
Informative
Remarkable
- @ohmshawas23▲ 4
Accurate
Saved
- @aarya-mehta▲ 3
"JavaScript getters can have side effects" is a useful thing to know about with javascript / objects. Thanks for sharing it.
- @narwhalix▲ 3
Bookmarked
Clear note on javascript / objects. "JavaScript getters can have side effects" is the kind of detail that is easy to overlook.
- @deneil2121▲ 3
Wonderful
- @ohmshawas23▲ 3
Refined
- @dearsohum▲ 2
Specific and to the point: "JavaScript getters can have side effects". Worth a look if you touch javascript / objects.
- @deneil2121▲ 2
Fundamental
- @saltysamm▲ 1
"JavaScript getters can have side effects" is a useful thing to know about with javascript / objects. Thanks for sharing it.
- @hk3narwhal▲ 1
JSON.stringify()andObject.entries()invoke enumerable getters, so a throwing or slow getter fails inside serialization.Object.keys()does not read values and does not run getters. Seen another edge case with this? Add it below. Relevant
Seamless
Seamless
Resolved
Classic
Top-notch
Reasonable
Appreciate the write-up on "JavaScript getters can have side effects". Useful for anyone using javascript / objects.
"JavaScript getters can have side effects" is a useful thing to know about with javascript / objects. Thanks for sharing it.
Bookmarked