We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad022d4 commit dcbec63Copy full SHA for dcbec63
doc/Language/js-nutshell.pod6
@@ -340,6 +340,21 @@ say 1 +^ 1; # OUTPUT: 0
340
say +^1; # OUTPUT: -2
341
=end code
342
343
+=head3 Checking for definedness
344
+
345
+Javascript includes a nullish coalescing operator, C<||>, which progresses
346
+only if null or undefined:
347
348
+=for code :lang<javascript>
349
+undefined || null || 0 || 1 ; // => 1
350
+undefined ?? null ?? 0 ?? 1 ; // => 0
351
352
+This is very similar to Raku L<C<//>|/routine/$SOLIDUS$SOLIDUS> operator:
353
354
+=for code
355
+(Any) || Nil || 0 || 1 ; # => 1
356
+(Any) // Nil // 0 // 1 ; # => 0
357
358
=head3 Custom operators and operator overloading
359
360
Node.js does not allow operator overloading without having to use a Makefile or
0 commit comments