. Optional Chaining Operator in JavaScript | Optional Chaining | | Optional Chaining vs Nullish

Опубликовано: 02 Январь 2021
на канале: Mvndr4u
55
7

The optional chaining operator (?.) permits reading the value of a property located deep within a chain of connected objects without having to expressly validate that each reference in the chain is valid. The ?. operator functions similarly to the . chaining operator, except that instead of causing an error if a reference is nullish (null or undefined), the expression short-circuits with a return value of undefined. When used with function calls, it returns undefined if the given function does not exist.

This results in shorter and simpler expressions when accessing chained properties when the possibility exists that a reference may be missing. It can also be helpful while exploring the content of an object when there's no known guarantee as to which properties are required.


На этой странице сайта вы можете посмотреть видео онлайн . Optional Chaining Operator in JavaScript | Optional Chaining | | Optional Chaining vs Nullish длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Mvndr4u 02 Январь 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 55 раз и оно понравилось 7 зрителям. Приятного просмотра!