Added support for adding objects

This commit is contained in:
Mike Farah
2022-01-23 11:35:44 +11:00
parent 9b66e0a094
commit 9b1a7bf451
4 changed files with 95 additions and 19 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ Add behaves differently according to the type of the LHS:
* arrays: concatenate
* number scalars: arithmetic addition
* string scalars: concatenate
* maps: shallow merge (use the multiply operator (`*`) to deeply merge)
Use `+=` as append assign for things like increment. Note that `.a += .x` is equivalent to running `.a = .a + .x`.
Use `+=` as a relative append assign for things like increment. Note that `.a += .x` is equivalent to running `.a = .a + .x`.
Add is not (yet) supported for maps - however you can use merge `*` which will have a similar effect...