Vimscript String Coercion
An unique feature of Vimscript is coercion of strings into integers.
Here's an example:
:echom "six" + 6
:echom "6six" + 6
:messages
6
12
Our messages show that the first string was coerced to 0
(0 + 6 = 6
), and the second string was coerced to 6
(6 + 6 = 12
).
Following this logic a little further, because 0
is falsey and 1
(or greater than 1
) is truthy, our first string is falsey and our second string is truthy.