If else efficiency

hey i was wondering which of the methods is best or if their is a method i don’t know about

if(sale === false) {
console.log(‘thing i want to say.’);
}

or is this better

if(sale) {}

else{

console.log(‘thing i want to say.’);

}

You could do

if (!sale) {
   console.log(`thing i want to say.`)
}

and that should do the job!

3 Likes