Nullish Coalescing Operator (??)
By xyz on 2 weeks ago|0 comment||
0
Use ??
to provide a default value for null
or undefined
.
let username = null;
console.log(username ?? "Guest"); // "Guest"
Add a Comment
Comments
Comments MIA, jokes needed ASAP. Add yours! 😄