You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/04-object-basics/07-optional-chaining/article.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,7 @@ La sintaxis `?.` tiene tres formas:
165
165
166
166
1.`obj?.prop`-- devuelve `obj.prop` si `obj` existe, si no, `undefined`.
167
167
2.`obj?.[prop]`-- devuelve `obj[prop]` si `obj` existe, si no, `undefined`.
168
-
3.`obj?.method()`-- llama a `obj.method()` si `obj` existe, sino devuelve `undefined`.
168
+
3.`obj?.method()`-- llama a `obj.method()` si `obj` existe, si no devuelve `undefined`.
169
169
170
170
Como podemos ver, todos ellos son sencillos y fáciles de usar. El`?.` comprueba la parte izquierda para `null/undefined` y permite que la evaluación continúe si no es así.
0 commit comments