repl.txt (1989B)
1 2 {{alias}}( value ) 3 Tests if a value is an array-like object containing only safe integers. 4 5 An integer valued number is "safe" when the number can be exactly 6 represented as a double-precision floating-point number. 7 8 Parameters 9 ---------- 10 value: any 11 Value to test. 12 13 Returns 14 ------- 15 bool: boolean 16 Boolean indicating whether value is an array-like object containing 17 only safe integers. 18 19 Examples 20 -------- 21 > var arr = [ -3.0, new Number(0.0), 2.0 ]; 22 > var bool = {{alias}}( arr ) 23 true 24 > arr = [ -3.0, '3.0' ]; 25 > bool = {{alias}}( arr ) 26 false 27 28 29 {{alias}}.primitives( value ) 30 Tests if a value is an array-like object containing only primitive safe 31 integer values. 32 33 Parameters 34 ---------- 35 value: any 36 Value to test. 37 38 Returns 39 ------- 40 bool: boolean 41 Boolean indicating whether value is an array-like object containing only 42 primitive safe integer values. 43 44 Examples 45 -------- 46 > var arr = [ -1.0, 10.0 ]; 47 > var bool = {{alias}}.primitives( arr ) 48 true 49 > arr = [ -1.0, 0.0, 5.0 ]; 50 > bool = {{alias}}.primitives( arr ) 51 true 52 > arr = [ -3.0, new Number(-1.0) ]; 53 > bool = {{alias}}.primitives( arr ) 54 false 55 56 57 {{alias}}.objects( value ) 58 Tests if a value is an array-like object containing only `Number` objects 59 having safe integer values. 60 61 Parameters 62 ---------- 63 value: any 64 Value to test. 65 66 Returns 67 ------- 68 bool: boolean 69 Boolean indicating whether value is an array-like object containing only 70 `Number` objects having safe integer values. 71 72 Examples 73 -------- 74 > var arr = [ new Number(1.0), new Number(3.0) ]; 75 > var bool = {{alias}}.objects( arr ) 76 true 77 > arr = [ -1.0, 0.0, 3.0 ]; 78 > bool = {{alias}}.objects( arr ) 79 false 80 > arr = [ 3.0, new Number(-1.0) ]; 81 > bool = {{alias}}.objects( arr ) 82 false 83 84 See Also 85 -------- 86