menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Expression...
source image

Dev

4w

read

422

img
dot

Image Credit: Dev

Expression? Statement? What's the difference?

  • An expression is code that is evaluated and turns into a value. For example, 2+2 evaluates to 4.
  • A statement is the smallest piece of code that tells the computer to do something. It is executed, not evaluated.
  • Expressions can't exist by themselves, they have to be wrapped in a statement.
  • Function expressions and function declarations/statements have a difference in focus, with expressions being more about evaluation and declarations being about execution.

Read Full Article

like

25 Likes

For uninterrupted reading, download the app