ECMAScript2020 (ES11) gives us another fantastic way to short-circuit our JavaScript when running into those pesky cases that have null and undefined. I guarantee you'll find a use for it :) With ?? we can hold up our code from running in cases where we need to know if something is nullish, similar to || but with more control. It works really well with optional chaining, and with a bit of practice, I bet you'll use it a ton.
Optional Chaining - • Optional Chaining In JavaScript: Awes...
Code: https://github.com/robertbunch/es-next
History of ECMAScript/JavaScript (long) - • Visual Timeline of JavaScript and ECM...
History of ECMAScript/JavaScript (shorter) - • Visual Timeline of JavaScript and ECM...
0:00 - Intro
0:23 - The Docs
0:55 - Nullish vs. Falsy
1:36 - Or vs. ??
2:18 - How to Use It - Use Case
5:52 - w/And and Or & More Examples
7:23 - w/optional chaining operator
9:27 - w/Functions
Смотрите видео Nullish Coalescing Operator - Unleash the Power of JavaScript Updates онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Good Morning Developers 06 Февраль 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,761 раз и оно понравилось 58 людям.