My favorite mnemonics for American vs British English
Use these weird tricks to remember which words are American English and which are British English. Linguists HATE them!
Use these weird tricks to remember which words are American English and which are British English. Linguists HATE them!
as
and is
operatorsA cast expression like (string)foo
throws
if the types don't match.
The as
operator doesn't throw
and defaults to null
.
The is
operator doesn't throw
and ignores null
s.
Both are guesses. Assume is weaker (little or no evidence), presume is stronger (reasonable evidence). But how to remember which is which?
array.shift()
vs array.unshift()
in JavaScriptPublished on in JavaScript and Mnemonics
Last updated on
shift()
removes the first array item,
and unshift()
prepends items to the array.
But how to remember which is which?
fn.apply()
vs fn.call()
in JavaScript + better alternativePublished on in JavaScript and Mnemonics
Last updated on
Mnemonic:
"a" (apply()
) for an array,
"c" (call()
) for commas.
But Reflect.apply()
is better.
Was it [text](url)
or (text)[url]
?
Use this one weird trick to remember –
Markdown consultants HATE it!
Spoiler: it's the former since it looks like a function call.