Overview
Everything contained inside a bracket pair prefixed by a $ (like $[this]) is considered as an expression and it is evaluated. Evaluation works similar to (but is done on a later stage than) variable substitution: the expression (including the square brackets) is replaced by the result of the expression evaluation.
For example, after the sequence:
the value of variable koko is "6".
And, further:
will parse as intended. Extra spaces are ignored.