yq/pkg/yqlib/doc/headers/Add.md

7 lines
264 B
Markdown
Raw Normal View History

2020-11-24 02:07:19 +00:00
Add behaves differently according to the type of the LHS:
- arrays: concatenate
2021-01-11 04:43:50 +00:00
- number scalars: arithmetic addition
- string scalars: concatenate
2021-01-11 04:43:50 +00:00
Use `+=` as append assign for things like increment. Note that `.a += .x` is equivalent to running `.a = .a + .x`.