-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
Description
Svelte is incorrectly casting numeric strings to numbers when assigned to component properties. This results in strange truthy behavior:
"1" is truthy
"true" is truthy
"false" is truthy
"0" is falsey
"0" is falsey
All of these strings should be truthy, but the number (and html entity for 0) are falsey.
https://svelte.technology/repl?version=1.22.5&gist=b75e1acf7ee81e6fb2b6d0ae0e8349d5