What is Optional Chaining and Nullish Coalescing? (ES2020)

The Quick Answer

Optional Chaining

if (object.property){
variable = object.property;
}
variable = object?.property

Nullish Coalescing

myNewVariables = possibleVariable || defaultValue;
myNewVariables = possibleVariable ?? defaultValue;

Conclusion

Alex Merced is a Full Stack Developer, learn more about his work at AlexMercedCoder.com

Alex Merced is a Full Stack Developer, learn more about his work at AlexMercedCoder.com