The object supplied to when can be from any source, such as a function. And, if you want, you can assign that value to a property, so you can reference it from your branches, such as we do here in the else branch.

You can learn more about this in:
Run Edit