-
Notifications
You must be signed in to change notification settings - Fork 35
Value
MitalAshok edited this page Nov 6, 2016
·
3 revisions
Returns the strict equality of the two operands.
this::equals(right)
-
this
: (any) The left operand to compare. -
right
: (any) The right operand to compare to.
"foo"::equals("bar") // false
"bar"::equals("bar") // true
Determine if the bound value is the same as the specified value.
this::is(value)
-
this
: (any) -
value
: (any) The value to compare the bound value to.
"foo"::is("foo") // true
"foo"::is("bar") // false
Returns the value of the property by given key.
this::prop(key)
-
this
: (any) -
key
: (string)
[1,2,3]::prop("length") // 3
Returns a function that always returns the given value.
this::toFunction()
-
this
: (T) The value the function should return.
let fn = 1::toFunction();
fn() // returns 1
fn() // returns 1