June 6th 2026 - Interesting Finds
JavaScript && and || return the value of the operand not true or false
In JavaScript && and || return the values its evaluating instead of true and false.
Logical AND (&&) evaluates operands from left to right, returning immediately with the value of the first falsy operand it encounters; if all values are truthy, the value of the last operand is returned.
OR returns the first truthy value.
Reference
JavaScript window vs globalThis
globalThis is a standard way of accessing the global "this" value. On browsers, historically it was window, self, or frames and in web workers it was self. In order to create a standard the globalThis value was introduced.
Reference
Emacs how to swap 2 words
We place the point in the space between 2 words and use (transpose-words) to swap them.
Emacs how to prompt the user with a yes or no question
We can use (y-or-n-p) to prompt the user. If the user responds with y then that is considered a true value.
Example:
(if (y-or-n-p "Your prompt goes here") (they-answered-y) (they-answered-n))