File: iteratorsAndStrictNullChecks.types

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (37 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (2)
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
=== 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[]