File: logicalAssignment1%28target%3Des2015%29.js

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (39 lines) | stat: -rw-r--r-- 695 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//// [logicalAssignment1.ts]
declare let a: string | undefined
declare let b: string | undefined
declare let c: string | undefined

declare let d: number | undefined
declare let e: number | undefined
declare let f: number | undefined

declare let g: 0 | 1 | 42
declare let h: 0 | 1 | 42
declare let i: 0 | 1 | 42


a &&= "foo"
b ||= "foo"
c ??= "foo"


d &&= 42
e ||= 42
f ??= 42

g &&= 42
h ||= 42
i ??= 42


//// [logicalAssignment1.js]
"use strict";
a && (a = "foo");
b || (b = "foo");
c !== null && c !== void 0 ? c : (c = "foo");
d && (d = 42);
e || (e = 42);
f !== null && f !== void 0 ? f : (f = 42);
g && (g = 42);
h || (h = 42);
i !== null && i !== void 0 ? i : (i = 42);