Hello 

This is the day 16 of #30 days of javascrip coding, at this day I studied Nullish Coalescing Operator And Logical Or and i learned that
1- Very simply put, the purpose of this lesson is to present data that will be an alternative to your data. If the original data is damaged or has a problem, there will be a replacement for it that will appear in its place, especially if this data is, for example, the price of a product.
2-If for some reason there is a problem with the variable of price, it becomes 0 and null here comes || Or which sends an alternative value, so you will find the 200 shown as a direct replacement in case a problem occurs
3- This alternative data is returned if the value of the variable is 0, null, undefined, or any Falsy value, and you can query these False values through the Constructor called Boolean.
4- The Nullish Coalescing has nothing to do with the Falsy value, unless the value is null or undefined. In this case, you will only be given an alternative to it in both cases.
5-If you want to show this zero specifically, and you want it to actually appear, or if you have other values that you would like to show in this case, use the Nullish sign?? 
6- If you write null or undefined here, the alternative will start returning
That's what I learned today 

Comments

Popular posts from this blog