Interesting example...I find the first much easier to read and reason about. ¯\_(ツ)_/¯
I don't think either is better but one is definitely familiar.
Generally I try not to care about syntax too much (except putting $ on the front of a variable, that annoys me not so much because they did but because not everyone did so every time I switch from PHP to TypeScript I end up putting $ on at least once a day), the weird part is that I write idiomatic code in both so my brain knows it shifted context but I still put the $.
let $foo = bar;
Just looks wrong.Weirder still when I run into code written by people who do
let $foo = $(foo);
For jQuery stuff (I totally get the reason why).Brains are funny things.