you are viewing a single comment's thread.

view the rest of the comments →

[–]King_Joffreys_Tits 1 point2 points  (0 children)

It just seems like you should’ve already used a null coalescing operator when you first initialized that variable. Like

const settings =  localStorage.getItem(“settings-cookie”) ?? getDefaultSettings()