Skip to content

Data Types

Zahir Hadi Athallah edited this page Jul 10, 2022 · 5 revisions

Enums

// Examples : 

enum theData (
  "LOW",
  "MEDIUM",
  "HIGH"
)

// the default value of the enums is 1
// you can also add the value for the enums
// Examples : 

enum theData (
  { LOW: 2 },
  { MEDIUM: 3},
  { HIGH: 4}
)

Interface

// Examples : 

interface Vehicle (
  name: String,
  price: Number
)

val myCars :
  this.name = "Honda Jazz",
  this.price = 5000000000
  getInterface(Vehicle, createProperty)

write(myCars.name)
write(myCars.price)

Readonly Data

// readonly data is useful for creating data that can only be retrieved, but cannot be changed
// Examples : 

readonly myData (
  name: "Zahir"
)

myData.prop = "Jimmy"
// Throws an Error

Define

// Define is useful for define a object with Advanced Options
// Examples : 

define myData: myObj (
  readonly: false,
  value: "Zahir",
  enums: false,
  config: true
)

Clone this wiki locally