File: iteratorsAndStrictNullChecks.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (36 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (5)
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
=== tests/cases/compiler/iteratorsAndStrictNullChecks.ts ===
// for..of
for (const x of ["a", "b"]) {
>x : string
>["a", "b"] : string[]
>"a" : "a"
>"b" : "b"

    x.substring;
>x.substring : (start: number, end?: number | undefined) => string
>x : string
>substring : (start: number, end?: number | undefined) => string
}

// Spread
const xs = [1, 2, 3];
>xs : number[]
>[1, 2, 3] : number[]
>1 : 1
>2 : 2
>3 : 3

const ys = [4, 5];
>ys : number[]
>[4, 5] : number[]
>4 : 4
>5 : 5

xs.push(...ys);
>xs.push(...ys) : number
>xs.push : (...items: number[]) => number
>xs : number[]
>push : (...items: number[]) => number
>...ys : number
>ys : number[]