Why you should use ?? instead of ||
We often see and write things like this: function sayHey(name) { name = name || "Precious"; console.log(`Hey ${name}`); } sayHey("Morty"); //Hey Morty sayHey(); //Hey Precious But did you know that the ?? operator, known as the nullish coal...
Jan 23, 20243 min read60
