From e64b9422a3afedb241ab9076f752f2cd037401c1 Mon Sep 17 00:00:00 2001 From: parulsingh23 <55006754+parulsingh23@users.noreply.github.com> Date: Tue, 1 Dec 2020 15:59:33 -0800 Subject: [PATCH 1/4] (expressions docs)Updated docs.json --- docs/docs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs.json b/docs/docs.json index 5a9bd5b1..e3b7cc16 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -338,7 +338,7 @@ "id": "mavoscript", "advanced": false, "title": "MavoScript", - "content": "Mavo’s **expression syntax** is called MavoScript. It is similar to spreadsheet formulas, but designed to be more readable and to accommodate nested relations (which spreadsheets cannot do).\n\nThey mostly consist of the following:\n\n# Property names\n\nYou use the value of a property you have defined by just typing its name. You can see some examples in the next section. You can use any property value from anywhere in your Mavo, or even in other Mavos (in that case, you'd need to add the app id before it, like `appid.propertyName`).\n\n##### Example\n\nMove the slider and check how both expressions are updated:\n\n```html\n

Slider value: [strength]/100

\n\n```\n\nThe values of properties depend on where your expression is placed. When you use properties inside collections you get **all values** outside the collection, and **just the value of the current item** inside a collection item.\n\n# Function calls\n\nFunctions transform values into different values, for example they can do math on a number, or tell if you some text contains some other text. They are written with their name, and then a comma-separated list of parameters in parentheses, e.g. `min(2, 5)`.\n\n

[All MavoScript functions](/docs/functions/?role=function)\n\n# Operators \n\nOperators are a shorter and more readable way to write common functions. For example, imagine if every time we wanted to subtract two numbers we had to write e.g. `subtract(2, 3)`. We would end up with a ton of parentheses for even simple expressions and it would be hard to understand what the expression actually does. Instead, we can write `2 - 3` instead, which is much shorter and more readable. Mavo supports all common math and logical operators, as well as some more like `where`.\n\n

[All MavoScript operators](/docs/functions/?role=operator)\n\n# Special properties\n\nSpecial properties are available in every Mavo, and start with a dollar sign ($). They contain metadata, such as [the position of the current collection item (as a number starting from 0)](docs/functions/#$index) or [the current date/time](docs/functions/#$now). \n\n

[All MavoScript special properties](/docs/functions/?role=special)\n\n# Raw data\n\nA lot of the data you will be using in expressions will come from your properties. However, sometimes you want to provide your own values as parameters. These can be:\n\n- **Numbers**, by just writing the number and using `.` as the decimal separator, e.g. `5` or `-0.3`. \n- The keyword `true` and the keyword `false` represent yes/no values. For example, `30 > 3` is equal to `true` because 30 is indeed larger than 3, and `3 > 30` is equal to `false` because 3 is not larger than 30.\n- Textual values, such as `\"cat\"` or `'Mary'`. You can use single quotes, double quotes, or even no quotes if the text contains only letters, numbers, and underscores. However, if you do that, beware of potential clashes with your property names!\n- Lists of values, just like those you get by referring a collection property from outside the collection, can be written as `list(value1, value2, value3, ...)`. You can read more about [`list()` here](/docs/functions/#list).\n- Grouped key-value pairs, just like the data you get when you reference a group can be created by using the `group()` function. E.g. `group(name: 'Vector', age: 12, hobby: list('Eating', 'Sleeping', 'Purring'))`\n\n" + "content": "Mavo’s **expression syntax** is called MavoScript. It is similar to spreadsheet formulas, but designed to be more readable and to accommodate nested relations (which spreadsheets cannot do).\n\nThey mostly consist of the following:\n\n# Property names\n\nYou use the value of a property you have defined by just typing its name. You can see some examples in the next section. You can use any property value from anywhere in your Mavo, or even in other Mavos (in that case, you'd need to add the app id before it, like `appid.propertyName`).\n\n##### Example\n\nMove the slider and check how both expressions are updated:\n\n```html\n

Slider value: [strength]/100

\n\n```\n\nThe values of properties depend on where your expression is placed. When you use properties inside collections you get **all values** outside the collection, and **just the value of the current item** inside a collection item.\n\n# Function calls\n\nFunctions transform values into different values, for example they can do math on a number, or tell if you some text contains some other text. They are written with their name, and then a comma-separated list of parameters in parentheses, e.g. `min(2, 5)`.\n\nYou can also call a javascript function just as you’d call a Mavo provided function. It is advisable to add the defined js function on `Mavo.Functions` to guarantee it is always accessible. However, do note that when the parameters are other properties in Mavo, you are passing in objects and not primitive values. Unexpected behavior and bugs can arise if you pass in these Mavo objects to your js function without knowing such.\n\n

[All MavoScript functions](/docs/functions/?role=function)\n\n# Operators \n\nOperators are a shorter and more readable way to write common functions. For example, imagine if every time we wanted to subtract two numbers we had to write e.g. `subtract(2, 3)`. We would end up with a ton of parentheses for even simple expressions and it would be hard to understand what the expression actually does. Instead, we can write `2 - 3` instead, which is much shorter and more readable. Mavo supports all common math and logical operators, as well as some more like `where`.\n\n

[All MavoScript operators](/docs/functions/?role=operator)\n\n# Special properties\n\nSpecial properties are available in every Mavo, and start with a dollar sign ($). They contain metadata, such as [the position of the current collection item (as a number starting from 0)](docs/functions/#$index) or [the current date/time](docs/functions/#$now). \n\n

[All MavoScript special properties](/docs/functions/?role=special)\n\n# Raw data\n\nA lot of the data you will be using in expressions will come from your properties. However, sometimes you want to provide your own values as parameters. These can be:\n\n- **Numbers**, by just writing the number and using `.` as the decimal separator, e.g. `5` or `-0.3`. \n- The keyword `true` and the keyword `false` represent yes/no values. For example, `30 > 3` is equal to `true` because 30 is indeed larger than 3, and `3 > 30` is equal to `false` because 3 is not larger than 30.\n- Textual values, such as `\"cat\"` or `'Mary'`. You can use single quotes, double quotes, or even no quotes if the text contains only letters, numbers, and underscores. However, if you do that, beware of potential clashes with your property names!\n- Lists of values, just like those you get by referring a collection property from outside the collection, can be written as `list(value1, value2, value3, ...)`. You can read more about [`list()` here](/docs/functions/#list).\n- Grouped key-value pairs, just like the data you get when you reference a group can be created by using the `group()` function. E.g. `group(name: 'Vector', age: 12, hobby: list('Eating', 'Sleeping', 'Purring'))`\n\n" }, { "id": "using-properties", From 1d10af4068544a80ffbc24720a83b274a5007d09 Mon Sep 17 00:00:00 2001 From: parulsingh23 <55006754+parulsingh23@users.noreply.github.com> Date: Wed, 2 Dec 2020 05:11:35 -0800 Subject: [PATCH 2/4] (expressions docs)Updated docs.json --- docs/docs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs.json b/docs/docs.json index e3b7cc16..f65f5050 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -338,7 +338,7 @@ "id": "mavoscript", "advanced": false, "title": "MavoScript", - "content": "Mavo’s **expression syntax** is called MavoScript. It is similar to spreadsheet formulas, but designed to be more readable and to accommodate nested relations (which spreadsheets cannot do).\n\nThey mostly consist of the following:\n\n# Property names\n\nYou use the value of a property you have defined by just typing its name. You can see some examples in the next section. You can use any property value from anywhere in your Mavo, or even in other Mavos (in that case, you'd need to add the app id before it, like `appid.propertyName`).\n\n##### Example\n\nMove the slider and check how both expressions are updated:\n\n```html\n

Slider value: [strength]/100

\n\n```\n\nThe values of properties depend on where your expression is placed. When you use properties inside collections you get **all values** outside the collection, and **just the value of the current item** inside a collection item.\n\n# Function calls\n\nFunctions transform values into different values, for example they can do math on a number, or tell if you some text contains some other text. They are written with their name, and then a comma-separated list of parameters in parentheses, e.g. `min(2, 5)`.\n\nYou can also call a javascript function just as you’d call a Mavo provided function. It is advisable to add the defined js function on `Mavo.Functions` to guarantee it is always accessible. However, do note that when the parameters are other properties in Mavo, you are passing in objects and not primitive values. Unexpected behavior and bugs can arise if you pass in these Mavo objects to your js function without knowing such.\n\n

[All MavoScript functions](/docs/functions/?role=function)\n\n# Operators \n\nOperators are a shorter and more readable way to write common functions. For example, imagine if every time we wanted to subtract two numbers we had to write e.g. `subtract(2, 3)`. We would end up with a ton of parentheses for even simple expressions and it would be hard to understand what the expression actually does. Instead, we can write `2 - 3` instead, which is much shorter and more readable. Mavo supports all common math and logical operators, as well as some more like `where`.\n\n

[All MavoScript operators](/docs/functions/?role=operator)\n\n# Special properties\n\nSpecial properties are available in every Mavo, and start with a dollar sign ($). They contain metadata, such as [the position of the current collection item (as a number starting from 0)](docs/functions/#$index) or [the current date/time](docs/functions/#$now). \n\n

[All MavoScript special properties](/docs/functions/?role=special)\n\n# Raw data\n\nA lot of the data you will be using in expressions will come from your properties. However, sometimes you want to provide your own values as parameters. These can be:\n\n- **Numbers**, by just writing the number and using `.` as the decimal separator, e.g. `5` or `-0.3`. \n- The keyword `true` and the keyword `false` represent yes/no values. For example, `30 > 3` is equal to `true` because 30 is indeed larger than 3, and `3 > 30` is equal to `false` because 3 is not larger than 30.\n- Textual values, such as `\"cat\"` or `'Mary'`. You can use single quotes, double quotes, or even no quotes if the text contains only letters, numbers, and underscores. However, if you do that, beware of potential clashes with your property names!\n- Lists of values, just like those you get by referring a collection property from outside the collection, can be written as `list(value1, value2, value3, ...)`. You can read more about [`list()` here](/docs/functions/#list).\n- Grouped key-value pairs, just like the data you get when you reference a group can be created by using the `group()` function. E.g. `group(name: 'Vector', age: 12, hobby: list('Eating', 'Sleeping', 'Purring'))`\n\n" + "content": "Mavo’s **expression syntax** is called MavoScript. It is similar to spreadsheet formulas, but designed to be more readable and to accommodate nested relations (which spreadsheets cannot do).\n\nThey mostly consist of the following:\n\n# Property names\n\nYou use the value of a property you have defined by just typing its name. You can see some examples in the next section. You can use any property value from anywhere in your Mavo, or even in other Mavos (in that case, you'd need to add the app id before it, like `appid.propertyName`).\n\n##### Example\n\nMove the slider and check how both expressions are updated:\n\n```html\n

Slider value: [strength]/100

\n\n```\n\nThe values of properties depend on where your expression is placed. When you use properties inside collections you get **all values** outside the collection, and **just the value of the current item** inside a collection item.\n\n# Function calls\n\nFunctions transform values into different values, for example they can do math on a number, or tell if you some text contains some other text. They are written with their name, and then a comma-separated list of parameters in parentheses, e.g. `min(2, 5)`.\n\n

[All MavoScript functions](/docs/functions/?role=function)\n\n# Custom Functions\n\nYou can also call your own custom javascript function just as you’d call a Mavo provided function. You can add these js functions as globals or as `Mavo.Functions`. However, It is advisable to add them on `Mavo.Functions` to guarantee they are always accessible.\n\n# Operators \n\nOperators are a shorter and more readable way to write common functions. For example, imagine if every time we wanted to subtract two numbers we had to write e.g. `subtract(2, 3)`. We would end up with a ton of parentheses for even simple expressions and it would be hard to understand what the expression actually does. Instead, we can write `2 - 3` instead, which is much shorter and more readable. Mavo supports all common math and logical operators, as well as some more like `where`.\n\n

[All MavoScript operators](/docs/functions/?role=operator)\n\n# Special properties\n\nSpecial properties are available in every Mavo, and start with a dollar sign ($). They contain metadata, such as [the position of the current collection item (as a number starting from 0)](docs/functions/#$index) or [the current date/time](docs/functions/#$now). \n\n

[All MavoScript special properties](/docs/functions/?role=special)\n\n# Raw data\n\nA lot of the data you will be using in expressions will come from your properties. However, sometimes you want to provide your own values as parameters. These can be:\n\n- **Numbers**, by just writing the number and using `.` as the decimal separator, e.g. `5` or `-0.3`. \n- The keyword `true` and the keyword `false` represent yes/no values. For example, `30 > 3` is equal to `true` because 30 is indeed larger than 3, and `3 > 30` is equal to `false` because 3 is not larger than 30.\n- Textual values, such as `\"cat\"` or `'Mary'`. You can use single quotes, double quotes, or even no quotes if the text contains only letters, numbers, and underscores. However, if you do that, beware of potential clashes with your property names!\n- Lists of values, just like those you get by referring a collection property from outside the collection, can be written as `list(value1, value2, value3, ...)`. You can read more about [`list()` here](/docs/functions/#list).\n- Grouped key-value pairs, just like the data you get when you reference a group can be created by using the `group()` function. E.g. `group(name: 'Vector', age: 12, hobby: list('Eating', 'Sleeping', 'Purring'))`\n\n" }, { "id": "using-properties", From 563a245c4f150518c1f2f4425004aa761cf130e3 Mon Sep 17 00:00:00 2001 From: parulsingh23 <55006754+parulsingh23@users.noreply.github.com> Date: Wed, 9 Dec 2020 00:30:03 -0800 Subject: [PATCH 3/4] (expressions docs)Updated docs.json --- docs/docs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs.json b/docs/docs.json index f65f5050..a2955820 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -338,7 +338,7 @@ "id": "mavoscript", "advanced": false, "title": "MavoScript", - "content": "Mavo’s **expression syntax** is called MavoScript. It is similar to spreadsheet formulas, but designed to be more readable and to accommodate nested relations (which spreadsheets cannot do).\n\nThey mostly consist of the following:\n\n# Property names\n\nYou use the value of a property you have defined by just typing its name. You can see some examples in the next section. You can use any property value from anywhere in your Mavo, or even in other Mavos (in that case, you'd need to add the app id before it, like `appid.propertyName`).\n\n##### Example\n\nMove the slider and check how both expressions are updated:\n\n```html\n

Slider value: [strength]/100

\n\n```\n\nThe values of properties depend on where your expression is placed. When you use properties inside collections you get **all values** outside the collection, and **just the value of the current item** inside a collection item.\n\n# Function calls\n\nFunctions transform values into different values, for example they can do math on a number, or tell if you some text contains some other text. They are written with their name, and then a comma-separated list of parameters in parentheses, e.g. `min(2, 5)`.\n\n

[All MavoScript functions](/docs/functions/?role=function)\n\n# Custom Functions\n\nYou can also call your own custom javascript function just as you’d call a Mavo provided function. You can add these js functions as globals or as `Mavo.Functions`. However, It is advisable to add them on `Mavo.Functions` to guarantee they are always accessible.\n\n# Operators \n\nOperators are a shorter and more readable way to write common functions. For example, imagine if every time we wanted to subtract two numbers we had to write e.g. `subtract(2, 3)`. We would end up with a ton of parentheses for even simple expressions and it would be hard to understand what the expression actually does. Instead, we can write `2 - 3` instead, which is much shorter and more readable. Mavo supports all common math and logical operators, as well as some more like `where`.\n\n

[All MavoScript operators](/docs/functions/?role=operator)\n\n# Special properties\n\nSpecial properties are available in every Mavo, and start with a dollar sign ($). They contain metadata, such as [the position of the current collection item (as a number starting from 0)](docs/functions/#$index) or [the current date/time](docs/functions/#$now). \n\n

[All MavoScript special properties](/docs/functions/?role=special)\n\n# Raw data\n\nA lot of the data you will be using in expressions will come from your properties. However, sometimes you want to provide your own values as parameters. These can be:\n\n- **Numbers**, by just writing the number and using `.` as the decimal separator, e.g. `5` or `-0.3`. \n- The keyword `true` and the keyword `false` represent yes/no values. For example, `30 > 3` is equal to `true` because 30 is indeed larger than 3, and `3 > 30` is equal to `false` because 3 is not larger than 30.\n- Textual values, such as `\"cat\"` or `'Mary'`. You can use single quotes, double quotes, or even no quotes if the text contains only letters, numbers, and underscores. However, if you do that, beware of potential clashes with your property names!\n- Lists of values, just like those you get by referring a collection property from outside the collection, can be written as `list(value1, value2, value3, ...)`. You can read more about [`list()` here](/docs/functions/#list).\n- Grouped key-value pairs, just like the data you get when you reference a group can be created by using the `group()` function. E.g. `group(name: 'Vector', age: 12, hobby: list('Eating', 'Sleeping', 'Purring'))`\n\n" + "content": "Mavo’s **expression syntax** is called MavoScript. It is similar to spreadsheet formulas, but designed to be more readable and to accommodate nested relations (which spreadsheets cannot do).\n\nThey mostly consist of the following:\n\n# Property names\n\nYou use the value of a property you have defined by just typing its name. You can see some examples in the next section. You can use any property value from anywhere in your Mavo, or even in other Mavos (in that case, you'd need to add the app id before it, like `appid.propertyName`).\n\n##### Example\n\nMove the slider and check how both expressions are updated:\n\n```html\n

Slider value: [strength]/100

\n\n```\n\nThe values of properties depend on where your expression is placed. When you use properties inside collections you get **all values** outside the collection, and **just the value of the current item** inside a collection item.\n\n# Function calls\n\nFunctions transform values into different values, for example they can do math on a number, or tell if you some text contains some other text. They are written with their name, and then a comma-separated list of parameters in parentheses, e.g. `min(2, 5)`.\n\n

[All MavoScript functions](/docs/functions/?role=function)\n\nYou can also call your own custom javascript function just as you’d call a Mavo provided function. You can add these js functions as globals or as `Mavo.Functions`. However, It is advisable to add them on `Mavo.Functions` to guarantee they are always accessible, e.g. `Mavo.Functions.increment = function(param) {return param + 1}`.\n\n# Operators \n\nOperators are a shorter and more readable way to write common functions. For example, imagine if every time we wanted to subtract two numbers we had to write e.g. `subtract(2, 3)`. We would end up with a ton of parentheses for even simple expressions and it would be hard to understand what the expression actually does. Instead, we can write `2 - 3` instead, which is much shorter and more readable. Mavo supports all common math and logical operators, as well as some more like `where`.\n\n

[All MavoScript operators](/docs/functions/?role=operator)\n\n# Special properties\n\nSpecial properties are available in every Mavo, and start with a dollar sign ($). They contain metadata, such as [the position of the current collection item (as a number starting from 0)](docs/functions/#$index) or [the current date/time](docs/functions/#$now). \n\n

[All MavoScript special properties](/docs/functions/?role=special)\n\n# Raw data\n\nA lot of the data you will be using in expressions will come from your properties. However, sometimes you want to provide your own values as parameters. These can be:\n\n- **Numbers**, by just writing the number and using `.` as the decimal separator, e.g. `5` or `-0.3`. \n- The keyword `true` and the keyword `false` represent yes/no values. For example, `30 > 3` is equal to `true` because 30 is indeed larger than 3, and `3 > 30` is equal to `false` because 3 is not larger than 30.\n- Textual values, such as `\"cat\"` or `'Mary'`. You can use single quotes, double quotes, or even no quotes if the text contains only letters, numbers, and underscores. However, if you do that, beware of potential clashes with your property names!\n- Lists of values, just like those you get by referring a collection property from outside the collection, can be written as `list(value1, value2, value3, ...)`. You can read more about [`list()` here](/docs/functions/#list).\n- Grouped key-value pairs, just like the data you get when you reference a group can be created by using the `group()` function. E.g. `group(name: 'Vector', age: 12, hobby: list('Eating', 'Sleeping', 'Purring'))`\n\n" }, { "id": "using-properties", From a1d48383f1ba85b98ac18913841167104ea4e1c0 Mon Sep 17 00:00:00 2001 From: parulsingh23 <55006754+parulsingh23@users.noreply.github.com> Date: Fri, 18 Dec 2020 00:42:43 -0800 Subject: [PATCH 4/4] (expressions docs)Updated docs.json --- docs/docs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs.json b/docs/docs.json index a2955820..b866e6b4 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -338,7 +338,7 @@ "id": "mavoscript", "advanced": false, "title": "MavoScript", - "content": "Mavo’s **expression syntax** is called MavoScript. It is similar to spreadsheet formulas, but designed to be more readable and to accommodate nested relations (which spreadsheets cannot do).\n\nThey mostly consist of the following:\n\n# Property names\n\nYou use the value of a property you have defined by just typing its name. You can see some examples in the next section. You can use any property value from anywhere in your Mavo, or even in other Mavos (in that case, you'd need to add the app id before it, like `appid.propertyName`).\n\n##### Example\n\nMove the slider and check how both expressions are updated:\n\n```html\n

Slider value: [strength]/100

\n\n```\n\nThe values of properties depend on where your expression is placed. When you use properties inside collections you get **all values** outside the collection, and **just the value of the current item** inside a collection item.\n\n# Function calls\n\nFunctions transform values into different values, for example they can do math on a number, or tell if you some text contains some other text. They are written with their name, and then a comma-separated list of parameters in parentheses, e.g. `min(2, 5)`.\n\n

[All MavoScript functions](/docs/functions/?role=function)\n\nYou can also call your own custom javascript function just as you’d call a Mavo provided function. You can add these js functions as globals or as `Mavo.Functions`. However, It is advisable to add them on `Mavo.Functions` to guarantee they are always accessible, e.g. `Mavo.Functions.increment = function(param) {return param + 1}`.\n\n# Operators \n\nOperators are a shorter and more readable way to write common functions. For example, imagine if every time we wanted to subtract two numbers we had to write e.g. `subtract(2, 3)`. We would end up with a ton of parentheses for even simple expressions and it would be hard to understand what the expression actually does. Instead, we can write `2 - 3` instead, which is much shorter and more readable. Mavo supports all common math and logical operators, as well as some more like `where`.\n\n

[All MavoScript operators](/docs/functions/?role=operator)\n\n# Special properties\n\nSpecial properties are available in every Mavo, and start with a dollar sign ($). They contain metadata, such as [the position of the current collection item (as a number starting from 0)](docs/functions/#$index) or [the current date/time](docs/functions/#$now). \n\n

[All MavoScript special properties](/docs/functions/?role=special)\n\n# Raw data\n\nA lot of the data you will be using in expressions will come from your properties. However, sometimes you want to provide your own values as parameters. These can be:\n\n- **Numbers**, by just writing the number and using `.` as the decimal separator, e.g. `5` or `-0.3`. \n- The keyword `true` and the keyword `false` represent yes/no values. For example, `30 > 3` is equal to `true` because 30 is indeed larger than 3, and `3 > 30` is equal to `false` because 3 is not larger than 30.\n- Textual values, such as `\"cat\"` or `'Mary'`. You can use single quotes, double quotes, or even no quotes if the text contains only letters, numbers, and underscores. However, if you do that, beware of potential clashes with your property names!\n- Lists of values, just like those you get by referring a collection property from outside the collection, can be written as `list(value1, value2, value3, ...)`. You can read more about [`list()` here](/docs/functions/#list).\n- Grouped key-value pairs, just like the data you get when you reference a group can be created by using the `group()` function. E.g. `group(name: 'Vector', age: 12, hobby: list('Eating', 'Sleeping', 'Purring'))`\n\n" + "content": "Mavo’s **expression syntax** is called MavoScript. It is similar to spreadsheet formulas, but designed to be more readable and to accommodate nested relations (which spreadsheets cannot do).\n\nThey mostly consist of the following:\n\n# Property names\n\nYou use the value of a property you have defined by just typing its name. You can see some examples in the next section. You can use any property value from anywhere in your Mavo, or even in other Mavos (in that case, you'd need to add the app id before it, like `appid.propertyName`).\n\n##### Example\n\nMove the slider and check how both expressions are updated:\n\n```html\n

Slider value: [strength]/100

\n\n```\n\nThe values of properties depend on where your expression is placed. When you use properties inside collections you get **all values** outside the collection, and **just the value of the current item** inside a collection item.\n\n# Function calls\n\nFunctions transform values into different values, for example they can do math on a number, or tell if you some text contains some other text. They are written with their name, and then a comma-separated list of parameters in parentheses, e.g. `min(2, 5)`.\n\n

[All MavoScript functions](/docs/functions/?role=function)\n\nYou can also call your own custom javascript function just as you’d call a Mavo provided function. You can add these JS functions as globals, e.g. `function xor(x,y) {return x!=y}`. However, It is advisable to instead add them on `Mavo.Functions` to guarantee they are always accessible, e.g. `Mavo.Functions.xor = function(x,y) {return x!=y}`.\n\n# Operators \n\nOperators are a shorter and more readable way to write common functions. For example, imagine if every time we wanted to subtract two numbers we had to write e.g. `subtract(2, 3)`. We would end up with a ton of parentheses for even simple expressions and it would be hard to understand what the expression actually does. Instead, we can write `2 - 3` instead, which is much shorter and more readable. Mavo supports all common math and logical operators, as well as some more like `where`.\n\n

[All MavoScript operators](/docs/functions/?role=operator)\n\n# Special properties\n\nSpecial properties are available in every Mavo, and start with a dollar sign ($). They contain metadata, such as [the position of the current collection item (as a number starting from 0)](docs/functions/#$index) or [the current date/time](docs/functions/#$now). \n\n

[All MavoScript special properties](/docs/functions/?role=special)\n\n# Raw data\n\nA lot of the data you will be using in expressions will come from your properties. However, sometimes you want to provide your own values as parameters. These can be:\n\n- **Numbers**, by just writing the number and using `.` as the decimal separator, e.g. `5` or `-0.3`. \n- The keyword `true` and the keyword `false` represent yes/no values. For example, `30 > 3` is equal to `true` because 30 is indeed larger than 3, and `3 > 30` is equal to `false` because 3 is not larger than 30.\n- Textual values, such as `\"cat\"` or `'Mary'`. You can use single quotes, double quotes, or even no quotes if the text contains only letters, numbers, and underscores. However, if you do that, beware of potential clashes with your property names!\n- Lists of values, just like those you get by referring a collection property from outside the collection, can be written as `list(value1, value2, value3, ...)`. You can read more about [`list()` here](/docs/functions/#list).\n- Grouped key-value pairs, just like the data you get when you reference a group can be created by using the `group()` function. E.g. `group(name: 'Vector', age: 12, hobby: list('Eating', 'Sleeping', 'Purring'))`\n\n" }, { "id": "using-properties",