I don't think uv = (msg.payload == false "clear") || "set" is valid in JavaScript
It looks like you're trying to use a conditional or ternary-like expression with this syntax.. uv = (msg.payload == false) ? "clear" : "set";
The construct you're referring to is called the ternary operator (or conditional operator). It's a shorthand way of writing an if...else statement in many programming languages like JavaScript, C, and Python (with a different syntax).
At the end of the day you need to use whatever 'format' you will be comfortable with. These 'tricks' (as you call them) are all well and good, but you need to consider... "will I be able to remember them in 6-months time?" This is especially true for people who dip in and out of programming at irregular times. So it might be easier to use a good old "if then else" construct.
The parentheses around the condition (msg.payload >= 47) are not strictly required, but they improve readability and help avoid confusion, especially when more complex expressions are involved.
Apologies for muddying the water but these different code snippets are only equivalent if the only possible values of msg.payload are boolean true or false.
IMHO, when handling boolean datatypes it's best to use the === true operator because that make it clear that you are expecting a boolean. The alternatives == and if (msg.payload) behave differently if fed a numeric or string value.
So for me this is the clearest and most compact code:
uv = (msg.payload === true) ? "set" : "clear"
ie if (msg.payload is boolean and it's value is true) ....
Andrew's premise was that the payload is true or false. If that is the case then there is no need to check for exact equality with true. If the value is actually something else, "x" or 7 for example then just using if (msg.payload) would result in "set", whereas if (msg.payload === true) would result in "clear". Which one of those is what Andrew would actually want should determine which syntax to use. If he is confident that it will always be a boolean, or does not care, then the simpler and more efficient if (msg.payload) can be used. If a non-boolean input should result in an error or other output then it is necessary to test for === true, and if it is not then test for === false and otherwise take appropriate other action.