Evaluate property presence without explicit value as true #41
Replies: 2 comments
-
I like how html does this! One potential conflict I see, though, is that identifiers are supposed to support being written as strings in order to be able to write arbitrary keys, but this feature would preclude that because the identifier would then be interpreted as a string argument instead of a boolean. I'm not sure how I feel about this feature only being available iff you're using plain identifiers? What do you think? |
Beta Was this translation helpful? Give feedback.
-
That's indeed quite the conflict. Having this only for "plain" identifiers doesn't make much sense since it would be awkward to explain IMO and could lead to a lot of user land bugs, so we probably have to leave this out Thank you for your consideration :) |
Beta Was this translation helpful? Give feedback.
-
Similar to how the presence of an attribute without value in HTML is set to
true
(HTML spec)So, using the example from the README
would be equivalent to
We could have a similar shorthand notation for when we want to express it as false, but I'm not as fond of that idea though:
Thoughts? What do you think? :)
Beta Was this translation helpful? Give feedback.
All reactions