const user_name = null ?? 'Ankit'; // Output: "Ankit" const number = 0 ?? 40; // Output: 0
If left side value of ?? is not undefined or null it will take that as a value.
0 Comments