I know am not the first to ask this and as I mentioned in my title ,I am trying to convert string value boolean .
I have previously put some values into local storage,No
I have been trying different values with JSON.parse(value)
and it seems to do the work:
// true
Boolean(JSON.parse("true"));
Boolean(JSON.parse("1"));
Boolean(JSON.parse(1));
Boolean(JSON.parse(true));
// false
Boolean(JSON.parse("0"));
Boolean(JSON.parse(0));
Boolean(JSON.parse("false"));
Boolean(JSON.parse(false));