Updated Introduction to Editor Scripting.md (markdown)
commited
commit
ad0606aa4193e5f14d345c3105a7b236088944f1
... | ... | @@ -14,5 +14,16 @@ Unlike most programming languages JS uses a versatile variable declaration this |
14 | 14 | |
15 | 15 | • `let` - is a variable that represents a local variable, its value only persist inside the codeblock `{}`` where it is located |
16 | 16 | |
17 | Each of this key can represent either `num` value types (`int`, `float`), `tru` types (`bool`), or `String` and can be changed to anytime according to the value type it holds. |
|
17 | Each of this key can represent either `num` value types (`int`, `float`), `tru` types (`bool`), or `String` and can be changed to anytime according to the value type it holds. Additionally it can also declare arrays, objects and functions. |
|
18 | ||
19 | ### Arrays and Objects |
|
20 | An array basically acts as a list that is automatically indexed, you can declare an array like this |
|
21 | ``` |
|
22 | var sample = ["apple", "orange", true, 100]; |
|
23 | ||
24 | var sample = []; |
|
25 | sample[0] = "mango"; |
|
26 | sample[2] = 0.1; |
|
27 | //outputs ["mango", undefined, 0.1] |
|
28 | ``` |
|
18 | 29 |