# Airscript Quickstart

Airscript is Airkit’s internal programming language. It is designed to be a simple but powerful language with a focus on data manipulation. By combining Airscript with input from app users (or other [external sources](../integration-guides/integrations-overview), such as an external API), you can control the order, flow, and nature of the interactions between your Airkit apps and the outside world.

\[block:embed] { "html": "\<iframe class="embedly-embed" src="//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FNxb9\_dvnh3Y%3Ffeature%3Doembed\&display\_name=YouTube\&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNxb9\_dvnh3Y\&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNxb9\_dvnh3Y%2Fhqdefault.jpg\&key=7788cb384c9f4d5dbbdbeffd9fe4b92f\&type=text%2Fhtml\&schema=youtube" width="854" height="480" scrolling="no" title="YouTube embed" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="true">", "url": "https://www.youtube.com/watch?v=Nxb9\_dvnh3Y", "title": "Airscript quickstart", "favicon": "https://www.google.com/favicon.ico", "image": "https://i.ytimg.com/vi/Nxb9\_dvnh3Y/hqdefault.jpg", "provider": "youtube.com", "href": "https://www.youtube.com/watch?v=Nxb9\_dvnh3Y", "typeOfEmbed": "youtube" } \[/block]

## Testing Airscript Expressions

When working with Airscript, it's often advantageous to test an Airscript expression before implementing it. [https://studio.airkit.com/play/](https://studio.airkit.com/play/) provides a sandbox environment to test Airscript expressions outside of any application.

## Functions

Like most programming languages, Airscript makes extensive use of functions. You can find documentation on all Airscript functions in [the **Airscript** section of our reference docs](../airscript-expressions/text-functions/capitalize).

## Arithmetic Operators

Airscript supports the standard [arithmetic operators](../airscript-expressions/arithmetic-operators): addition (+), subtraction (-), multiplication (\*) , and division (/), as well as remainder (%).

Unlike Airscript functions, Airscript operators not placed before the variables they are operating on, but rather between them, analogous to how operators are written in simple arithmetic equations. For instance, the following example shows you the addition operator (+) would be used to compute 2 plus 2:

```javascript
2 + 2 -> 4
```

All arithmetic operators are capable of operating on [Numbers](../variable-data-types/the-number-variable-data-type) and likewise returning Numbers as output. Some arithmetic operators are also capable of operating on variables of other Data Types. See [documentation on individual operators](../airscript-expressions/arithmetic-operators) for details.

### Order of Operations

Airscript arithmetic operators are performed according to mathematical conventions. That is, an expression that contains multiple arithmetic operators will perform operations in the following order:

1. **Parentheses** - Operations grouped into parenthesis are resolved first.
2. **Multiplication, Division, and Remainders** - Multiplication, division, and remainder operations are resolved next. They are resolved from left to right.
3. **Addition and Subtraction** - Addition and subtraction operations are resolved next. They are resolved from left to right.

## Comparison Operators

Airscript has a number of [comparison operators](../airscript-expressions/comparison-operators).

Unlike Airscript functions, Airscript operators not placed before the variables they are operating on, but rather between them, analogous to how operators are written in simple arithmetic equations. For instance, the following example uses the equality operator (=) to check if 2 is equal to 2:

```json
2 = 2 -> TRUE
```

All comparison operators return a [Boolean](../variable-data-types/the-boolean-variable-data-type) as output. They are commonly used in tandem with Airscript functions such as [IF](../airscript-expressions/conditional-functions/if), which requires Boolean input.

All comparison operators are capable of comparing two [Numbers](../variable-data-types/the-number-variable-data-type), [Times](../variable-data-types/the-time-variable-data-type), [Dates](../variable-data-types/the-date-variable-data-type), [DateTimes](../variable-data-types/the-datetime-variable-data-type), [Currencies](../variable-data-types/the-currency-variable-data-type), and [strings](../variable-data-types/the-text-variable-data-type). See documentation on individual operators for details.

## Displaying Airscript Output in an App

Airscript expressions can be used to define [Labels](../web-controls/label-web-control) that display dynamic information. For instance, a Label defined by the following string will display declare the current date and time:

```javascript
"It is currently {{
  FORMAT_DATETIME(
    NOW(),
    "MMMM Do, YYYY h:mm A z"
  )
}}."
```

Note how the Airscript expression that consists of the functions [FORMAT\_DATETIME](../airscript-expressions/datetime-functions/format_datetime) and [NOW](../airscript-expressions/datetime-functions/now) is delineated by double curly brackets. When Airscript expressions that require evaluation are inserted into strings, they are delineated by double curly brackets.

## Accessing Data

### Accessing Variables

Airscript expressions have access to variables, but only the variables within an accessible namespace. Different Airscript expression editors have access to different variable namespaces. For more on how to conceptualize and work with variables in Airkit, see [Variable Namespaces](variable-namespaces).

### Accessing Object Properties

Objects are a data type that relates field names to values. For example, an address in the United States is typically made up of a Street, City, State, and Zipcode. In Airkit, an example of an Object holding such data might look like this:

```javascript
{  
  street: "200 California Ave.",  
  city: "Palo Alto",  
  state: "CA",  
  zip: "94036"  
}
```

In order to access the **street** property, one would use dot notation:

```javascript
({  
  street: "200 California Ave.",  
  city: "Palo Alto",  
  state: "CA",  
  zip: "94036"  
}).street
```

or, if this Object is stored in a local variable called `address`:

```javascript
address.street
```

For more on how to access individual values in Objects, see [Pull Values from Lists and Objects](pull-values-from-lists-and-objects).

### Accessing Items in a List

Lists are a data type that store data in a particular order. Imagine we have a list of book titles, in Airscript it might look like this:

```javascript
[  
  "The Little Schemer",  
  "The Seasoned Schemer",  
  "The Reasoned Schemer",  
  "The Little Prover",  
  "The Little Typer"  
]
```

A particular item can be accessed from a list by its numerical index in the list. Indices begin at the number zero, in other words, the first item in the list is accessed at index **0**. In order to retrieve the book title "The Little Schemer" from our example you would do so like this:

```javascript
[  
  "The Little Schemer",  
  "The Seasoned Schemer",  
  "The Reasoned Schemer",  
  "The Little Prover",  
  "The Little Typer"  
][0]
```

or, if this list is stored in a local variable called `books`:

```json
books[0]
```

For more on how to access items in Lists, see [Pull Values from Lists and Objects](pull-values-from-lists-and-objects).

## Creating User Defined Functions

User Defined Functions (UDFs) are custom functions made out of and parsable by Airscript. They can be used as part of an application in the same way as out-of-the-box Airscript functions can, including when defining other UDFs.

UDFs are defined in the [Connections Builder](../studio/builder-bar/connections-builder). For a deeper dive into how UDFs are defined, check out [Creating Custom Functions](../building-apps/advanced/creating-custom-functions).
