add
Syntax
add(value1, value2, ...)Arguments
Examples
add(1, 2, 3)
// 6add(1.5, 2.5)
// 4.0[1, 2, 3].add($this...)
// 6Last updated
Adds all of the given numbers.
Accepts int and float.
If any floats are given, float is returned.
If no floats are given, int is returned.
add(value1, value2, ...)values (int | float) - Two or more numeric values to add.
Integer addition
add(1, 2, 3)
// 6Float addition
add(1.5, 2.5)
// 4.0Add values from an array using spread
[1, 2, 3].add($this...)
// 6CLI usage
Last updated
$ echo '{"a": 10, "b": 20}' | dasel -i json 'add(a, b)'
30