Property

Property

static

exit

[Global] Exits the program (alias for process.exit)

Parameter

Name Type Optional Description

exit_code

(number or string)

Yes

Defaults to 0.

Returns

void 

Methods

static

corners(area) → number

Finds the number of corners in an area

Parameter

Name Type Optional Description

area

_Set containing Vec

 

The area to find corners in

Returns

number 

static

eq(a, b) → boolean

[Global] Checks a and b are equal. In theory this works for any two values, whether they're primitives, arrays or some other object.

Parameters

Name Type Optional Description

a

any

 

b

any

 

Returns

boolean 

static

len(value) → number

[Global] Tries to get the length property of value otherwise tries to get size

Parameter

Name Type Optional Description

value

any

 

Value to get the length/size of

Returns

nullable number 

static

neq(a, b) → boolean

[Global] Checks a and b are not equal (by negating misc_utils.eq)

Parameters

Name Type Optional Description

a

any

 

b

any

 

Returns

boolean 

static

pr(value) → T

[Global] Same as misc_utils.print but niladic (so that it becomes a getter)

Parameter

Name Type Optional Description

value

T

 

Value to print

Returns

T 

static

print(...values) → (T or Array of T)

[Global] Same as console.log its arg(s)

Parameter

Name Type Optional Description

values

T

 

Values to print

Value can be repeated.

Returns

(T or Array of T) 

static

range(a[, b][, step]) → Array of number

[Global] Creates the range [a, b) in an array with an optional step size

Examples

range(4) // [0, 1, 2, 3]
range(2, 5) // [2, 3, 4]
range(1, 10, 2) // [1, 3, 5, 7, 9]

Parameters

Name Type Optional Description

a

number

 

End of the range (if b is not provided)

b

number

Yes

End of the range (if provided, in which case a is the start)

Defaults to 0.

step

number

Yes

Defaults to 1.

Returns

Array of number 

static

wrap(value) → Array of T

Wraps a value in a singleton list

Parameter

Name Type Optional Description

value

T

 

Value to wrap

Returns

Array of T