Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

Latest commit

 

History

History
73 lines (49 loc) · 1.09 KB

literals.md

File metadata and controls

73 lines (49 loc) · 1.09 KB

Literals

Boolean

Represents the Boolean type. It has two possible values true and false.

true
false

Number

Represents the Number type from JavaScript.

3.14
42
-10

{% hint style="info" %} Currently there are no support for other representations such as hex or binary. {% endhint %}

String

Represents the String type from JavaScript.

"hello world"

Escaping works as in JavaScript:

"hello \"world\""

Strings can span multiple lines

"hello
world"

or can be split into smaller consecutive parts

"hello " \
"world" == "hello world"

you interpolate expressions in a string with the #{...} syntax.

try {
  name = "Joe"
  
  "Hello #{name}" /* Hello Joe */
}

Array

An Array is a generic type containing elements of any other type.

It is typically created with an array literal:

[1, 2, 3]