Thanks Greg, we can avoid the ternary.
But suppose a case if we didn't get theme from browser's localStorage, then it will throw undefined and assigned to isDark, but yes we can handle that later. To make the article more understandable I made it like that, so I will convey the code more clearly.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks Greg, we can avoid the ternary.
But suppose a case if we didn't get theme from browser's localStorage, then it will throw undefined and assigned to isDark, but yes we can handle that later. To make the article more understandable I made it like that, so I will convey the code more clearly.