xxxxxxxxxx
const isCondition='true';
const returnedCondition= JSON.parse(isCondition.toLowerCase());
//shall return true as a boolean
typeof returnedCondition // 'boolean'
xxxxxxxxxx
function parseBool(value) {
if (typeof value === "string") {
value = value.toLowerCase();
if (value === "true" || value === "false") {
return value === "true";
}
}
return; // returns undefined
}