This function cast any variable into type ‘boolean’

function parseBool(value) {
     return !!value;
}

console.log(typeof parseBool({}));
// “boolean"