...but in this example I find the first to be far faster and easier to read. The "labeled" versions don't add any information that isn't obvious from the function names in the first.
If you were giving business logic names rather than generic names (e.g. "msgRecipient", "recipientFriends", "visibleFriends" then I could see more value. But even then, I would find the following the easiest:
function funcA(graph) {
return (graph
.nodes(`node[name = ${name}]`) // message recipient
.connected() // recipient friends
.nodes()
.not('.hidden') // inside current scroll area
.data('name')
);
}
This keeps the code itself simple and obvious, prevents a ton of repetition of variable names, and allows for longer descriptions than you'd want in a variable name.