Difference between null and undefined in JavaScript 🚀
🧵👇
🧵👇
Don't forget to bookmarked it for future references...
✦ In JavaScript, null and undefined are special values that represent the absence of a value or object.
☆ null
• null is a value that can be assigned to a variable as a representation of no value.
• It is an explicit representation of the absence of a value.
• Example :
let y = null;
console.log(y); // Output: null
• null is a value that can be assigned to a variable as a representation of no value.
• It is an explicit representation of the absence of a value.
• Example :
let y = null;
console.log(y); // Output: null
✦ It is important to note that null and undefined are not the same.
✦ undefined means a variable has been declared but has not been assigned a value, while null means a variable has been declared and has been assigned the value null explicitly.
✦ undefined means a variable has been declared but has not been assigned a value, while null means a variable has been declared and has been assigned the value null explicitly.
☆ Summary
• undefined represents the absence of a value, while null represents the absence of an object.
End thread 🧵
• undefined represents the absence of a value, while null represents the absence of an object.
End thread 🧵
If this thread helpful for you then :
1. Do Retweet the FIRST TWEET.
2. Follow me and turn on the notifications: @personalvipin
Thank you ❤️
1. Do Retweet the FIRST TWEET.
2. Follow me and turn on the notifications: @personalvipin
Thank you ❤️
جاري تحميل الاقتراحات...