Is there a function/method to evaluate whether a value evaluates to true
or false
in javascript? If not, is the following a good substitute?
const toBool = (x) => x ? true : false;
Is there a function/method to evaluate whether a value evaluates to true
or false
in javascript? If not, is the following a good substitute?
const toBool = (x) => x ? true : false;