You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
TS 3.7 Release Notes Nullish Coalescing example wrong #1135
I know this was only given as an example, but there's a small mistake:
Screenshot:
What is wrong?
It says that let volume = localStorage.volume || 0.5 will be 0.5 when localStorage.volume is set to 0, but everything stored in localStorage can only be a string and "0" is truthy.
localStorage.volume = 0; // saved as "0"
let volume = localStorage.volume || 0.5; // volume = "0" || 0.5
volume === "0" // Not 0.5 as mentioned in the example
Activity
[-]TS 3.7 Nullish Coalescing example wrong[/-][+]TS 3.7 Release Notes Nullish Coalescing example wrong[/+]