File: repl.txt

package info (click to toggle)
node-stdlib 0.0.96%2Bds1%2B~cs0.0.429-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 421,476 kB
  • sloc: javascript: 1,562,831; ansic: 109,702; lisp: 49,823; cpp: 27,224; python: 7,871; sh: 6,807; makefile: 6,089; fortran: 3,102; awk: 387
file content (132 lines) | stat: -rw-r--r-- 3,288 bytes parent folder | download
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132

{{alias}}( value )
    Determines a value's type.

    The following values are not natively provided in older JavaScript engines:

    - Map
    - Set
    - WeakMap
    - WeakSet
    - Symbol

    Parameters
    ----------
    value: any
        Input value.

    Returns
    -------
    out: string
        The value's type.

    Examples
    --------
    // Built-ins:
    > var t = {{alias}}( 'a' )
    'string'
    > t = {{alias}}( 5 )
    'number'
    > t = {{alias}}( NaN )
    'number'
    > t = {{alias}}( true )
    'boolean'
    > t = {{alias}}( false )
    'boolean'
    > t = {{alias}}( null )
    'null'
    > t = {{alias}}( undefined )
    'undefined'
    > t = {{alias}}( [] )
    'array'
    > t = {{alias}}( {} )
    'object'
    > t = {{alias}}( function noop() {} )
    'function'
    > t = {{alias}}( Symbol( 'beep' ) )
    'symbol'
    > t = {{alias}}( /.+/ )
    'regexp'
    > t = {{alias}}( new String( 'beep' ) )
    'string'
    > t = {{alias}}( new Number( 5 ) )
    'number'
    > t = {{alias}}( new Boolean( false ) )
    'boolean'
    > t = {{alias}}( new Array() )
    'array'
    > t = {{alias}}( new Object() )
    'object'
    > t = {{alias}}( new {{alias:@stdlib/array/int8}}( 10 ) )
    'int8array'
    > t = {{alias}}( new {{alias:@stdlib/array/uint8}}( 10 ) )
    'uint8array'
    > t = {{alias}}( new {{alias:@stdlib/array/uint8c}}( 10 ) )
    'uint8clampedarray'
    > t = {{alias}}( new {{alias:@stdlib/array/int16}}( 10 ) )
    'int16array'
    > t = {{alias}}( new {{alias:@stdlib/array/uint16}}( 10 ) )
    'uint16array'
    > t = {{alias}}( new {{alias:@stdlib/array/int32}}( 10 ) )
    'int32array'
    > t = {{alias}}( new {{alias:@stdlib/array/uint32}}( 10 ) )
    'uint32array'
    > t = {{alias}}( new {{alias:@stdlib/array/float32}}( 10 ) )
    'float32array'
    > t = {{alias}}( new {{alias:@stdlib/array/float64}}( 10 ) )
    'float64array'
    > t = {{alias}}( new {{alias:@stdlib/array/buffer}}( 10 ) )
    'arraybuffer'
    > t = {{alias}}( new Date() )
    'date'
    > t = {{alias}}( new RegExp( '.+' ) )
    'regexp'
    > t = {{alias}}( new Map() )
    'map'
    > t = {{alias}}( new Set() )
    'set'
    > t = {{alias}}( new WeakMap() )
    'weakmap'
    > t = {{alias}}( new WeakSet() )
    'weakset'
    > t = {{alias}}( new Error( 'beep' ) )
    'error'
    > t = {{alias}}( new TypeError( 'beep' ) )
    'typeerror'
    > t = {{alias}}( new SyntaxError( 'beep' ) )
    'syntaxerror'
    > t = {{alias}}( new ReferenceError( 'beep' ) )
    'referenceerror'
    > t = {{alias}}( new URIError( 'beep' ) )
    'urierror'
    > t = {{alias}}( new RangeError( 'beep' ) )
    'rangeerror'
    > t = {{alias}}( new EvalError( 'beep' ) )
    'evalerror'
    > t = {{alias}}( Math )
    'math'
    > t = {{alias}}( JSON )
    'json'

    // Arguments object:
    > function beep() { return arguments; };
    > t = {{alias}}( beep() )
    'arguments'

    // Node.js Buffer object:
    > t = {{alias}}( new {{alias:@stdlib/buffer/ctor}}( 10 ) )
    'buffer'

    // Custom constructor:
    > function Person() { return this };
    > t = {{alias}}( new Person() )
    'person'

    // Anonymous constructor:
    > var Foo = function () { return this; };
    > t = {{alias}}( new Foo() )
    '' || 'foo'

    See Also
    --------