Skip to content
MitalAshok edited this page Nov 6, 2016 · 3 revisions

Methods Defined Here

Returns the strict equality of the two operands.

Parameters

this::equals(right)
  • this: (any) The left operand to compare.
  • right: (any) The right operand to compare to.

Basic Usage

"foo"::equals("bar") // false
"bar"::equals("bar") // true

Determine if the bound value is the same as the specified value.

Parameters

this::is(value)
  • this: (any)
  • value: (any) The value to compare the bound value to.

Basic Usage

"foo"::is("foo") // true
"foo"::is("bar") // false

Returns the value of the property by given key.

Parameters

this::prop(key)
  • this: (any)
  • key: (string)

Basic Usage

[1,2,3]::prop("length") // 3

Returns a function that always returns the given value.

Parameters

this::toFunction()
  • this: (T) The value the function should return.

Basic Usage

let fn = 1::toFunction();
fn() // returns 1
fn() // returns 1