I usally write this kind of conditions:
if (title && content){
// code
}
But then I see this example:
const canSave = Boolean(title) && Boolean(content) && Boolean(userId)
And they used canSave to pass in to disabled prop in a button.
Is it a best practice to use Boollean instead of just doing the following?
const canSave = title && content && userId
In what cases should I use Boolean()?