I want to assign an expression to a variable, and if it has no value, use some default.
On almost every programming language I can use something like:
let linked_hl_id = hlID(l:linked_group) || 114
But of course it does not work, and the option I found is this eyesore using ternary and 2 lines of assignment:
let linked_hl_id = hlID(l:linked_group)
let linked_hl_id = linked_hl_id ? linked_hl_id : 114
What is a better syntax for that?
Using NVIM v0.4.4
.
Thanks.