Update variables documentation
@@ -22,7 +22,7 @@ nav_order: 3
| String | "Hello World!", 'Hello World!' |
| Boolean | true, false |
| List | Lists can contain any value. <br/><br/>[1, 2, "hi", true, nil] |
-| Dictionary | Dictionaries are key value pairs. Currently keys have to be strings, nil, boolean, number). <br/><br/>{"key1": 10, 2: "two", true: "true", nil: "nill"} |
+| Dictionary | Dictionaries are key value pairs. Keys need to be of type string, nil, boolean or number. <br/><br/>{"key1": 10, 2: "two", true: "true", nil: "nil"} |
| Set | Sets are an unordered collection of unique hashable values.
| nil | nil |
@@ -38,13 +38,13 @@ var someFalseBoolean = false;
var someNilValue = nil;
var someOtherNilValue; // Variables declared without a value are set to nil
var someList = [1, 2, "hi", 'hi', nil, true, false]; // Lists can hold any value
-var someDict = {"key": 10, "key1": true, "key2": [1, "2", false], "key3": {"1": 2}}; // Dictionaries must have a string key, but can hold any value
+var someDict = {"key": 10, "key1": true, 2: [1, "2", false], true: {"1": 2}};
var someSet = set();
```
To define a variable in Dictu the syntax is as follows `var <identifier> = <value>;` where identifier
-is defined as such `[a-zA-Z_][a-zA-Z_]*` and value is a valid datatype.
+is defined as such `[a-zA-Z_]+` and value is a valid datatype.
Once a variable has been defined, `var` is no longer needed to update the value of the variable.
@@ -70,13 +70,15 @@ var a, b = 10, c = "hello!";
print(a, b, c); // nil, 10, 'hello!'
```
-You can convert types into strings with the toString() method.
+## Casting
+
+You can convert values into strings with the toString() method.
```js
true.toString();
nil.toString();
1.toString();
-somedict.toString();
-somelist.toString();
-someset.toString();
+someDict.toString();
+someList.toString();
+someSet.toString();
```
