📄️ Variables
Variables in Fig are used to store and manipulate data. There are two types of variables:
📄️ Arrays
Arrays in Fig allow you to store and manipulate collections of elements. This document outlines the basic operations and usage of arrays in Fig.
📄️ Comments
Comments in Fig are used to add explanatory notes or documentation to the code. There are two types of comments:
📄️ Control flow
Control flow statements in Fig are used to control the execution of code based on conditions or loops. Here are some common control flow statements:
📄️ Data Types
Fig supports various data types for representing different kinds of values. Here are some commonly used data types:
📄️ External Statement
The external statement allows you to import functions from the host language environment, such as JavaScript, which can be executed within the WebAssembly (WASM) environment. This enables Fig to interact with the host environment seamlessly.
📄️ Functions
Functions in Fig are blocks of code that perform a specific task. They are declared using the fn keyword followed by the function name, parameters (if any), and return type (if any). Here's the general syntax for defining a function:
📄️ Import
Fig allows you to import modules or files using the import statement. This enables you to reuse code from other files or standard libraries. For example: