- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
var anyVariableName=null; var anyVariableName=yourVariableName || yourActualValue;
var fullName=null; console.log("The full name is="+fullName); var actualName=fullName || "David Miller"; console.log("The full name is="+actualName);
To run the above program, you need to use the following command −
Here, my file name is demo81.js.
This will produce the following output −
- How to use Null Coalescing Operator (??) in C#?
- Difference between the Ternary operator and Null coalescing operator in php
- Is there a “not equal” operator in Python?
- What is MySQL NULL-safe equal operator and how it is different from comparison operator?