☄️
SpaceTode
  • Introduction
  • Element
  • Properties
  • Data
  • Arguments
  • Rules
  • Diagrams
  • Inputs
  • Outputs
  • Transformations
  • Symmetries
  • Symbols
  • Event Arguments
  • Maybe
  • Point of View
  • Actions
  • Mimic
  • Sub-Elements
  • Blocks
  • Scoping
  • JavaScript
  • Behave
  • Tabs and Spaces
Powered by GitBook
On this page

Was this helpful?

JavaScript

All values and functions are written in embedded JavaScript in SpaceTode. For example, all the symbol functions are written in JavaScript:

given W (element) => element === Water

The JavaScript above is (element) => element === Water. You can extend your JavaScript over multiple lines by ending a line with a bracket:

given W (element) => {
    return element === Water
}

You can also place your JavaScript within brace brackets if you want to make a closure:

given W { return (element) => element === Water }
PreviousScopingNextBehave

Last updated 4 years ago

Was this helpful?