This is an expression:
console.log(5 + 5) // result: 10
Here’s what’s happening above:
An expression is a way to get the result of or the evaluation of (same thing, different word) of an input — in this case, 5 + 5.
console.log(typeof()) // result: object
 (square brackets)?”
Surprised? Did you expect this term to evolve something more complicated?
If you did, you’re not alone. Here’s the dictionary definition of expression:
- the action of making known one's thoughts or feelings.
- a look on someone's face that conveys a particular emotion.
I don’t know about you, but there’s nothing in the two definitions above that sounds like it has anything to do with the code example above.
However, if you look at how the term expression is used in math you will probably find it more relatable. But if you’re like me, and your first language is not English, there’s a pretty good chance that you didn’t think about math the first time you heard “expression” in the context of programming.
When you have a hard time associating words with a context (in this case, programming) it’s usually harder to remember, and that puts up a mental barrier that makes even simple concepts harder to wrap your head around.
This is why I always say that learning the contextual meaning of tech terms is half the battle when you’re learning how to code
Fortunately, the solution is simple. You just need repetition until it sticks. Eventually, you will start to associate expressions with programming when you are in a programming context, just like you associate it with things like “assertion, announcement, looks” and other things outside of programming.