I'm using Local Storage in the browser to set a boolean property.
As Local Storage uses strings I'm having to convert to bool as a library function requires a true/false bool rather than string.
Best I've been able to do is the below. It works but seems very clunky.
var t = localStorage.getItem("showTitle")
if (t=="false") { _showTitle = false}
if (t=="true") { _showTitle = true }
I also need to toggle this property based on a button being selected, hence, could do with a cleaner way of handling this if possible.