Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9128683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:34:22+00:00 2026-06-17T07:34:22+00:00

I just started to learn JavaScript with the book Eloquent JavaScript, which is accessible

  • 0

I just started to learn JavaScript with the book “Eloquent JavaScript”, which is accessible free of charge at eloquentjavascript.net. So far I really like the book, there’s just one section I don’t understand. It’s the one about expressions and statements:

http://eloquentjavascript.net/chapter2.html#p65af5913

I know this topic has been mentioned on StackOverflow before, however, these were more specific questions and I – quite frankly – don’t get the whole thing.

In the beginning of the paragraph, the author explains what expressions are: If I understand it correctly, atomic values such as 42 or “23” are being considered expressions. If one applied those values to an operator (as in 42 – 19), this would be considered an expression, too. (I guess because it obviously turns out to be 23, which is an atomic value once again.) I interpret this the following way: Every value – no matter whether it’s directly typed in or is yet to be calculated – is being called an expression. Is that correct?

Then the author says the following: “There exists a unit that is bigger than an expression. It is called a statement. […] Most statements end with a semicolon (;). The simplest kind of statement is an expression with a semicolon after it.” As an example he mentions

!false;

as an example statement. My questions is “What makes this a statement? Just the semicolon at the end?” When I use the JavaScript console, it makes absolutely no difference whether I type that in with or without the semicolon. It always returns true. However, the author says that “[A] statement only amounts to something if it somehow changes the world.” So the given example is not even a statement since it “just produce[s] the value […] true, and then immediately throw[s it] into the bit bucket”? I am really confused now… If I did not entirely mess it up in my head, a statement has to have some “side-effect” (like a declaration of a variable), right?

However, I would be very happy if someone could explain what a statement is. It would also be very helpful if someone could give an example in which the distinction of those terms is actually useful, because right now I cannot even imagine why the author even bothers to introduce these vocabularies. Thank you very much in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:34:23+00:00Added an answer on June 17, 2026 at 7:34 am

    A simple, albeit vague, analogy would be a text in a natural language, consisting of phrases grouped into sentences. A phrase, like “it’s raining” can form a sentence by itself, like “I won’t go out. It’s raining.” or be a part of a bigger sentence, like in “Terrible weather, it’s raining all the time.”

    That said, the distinction between expressions and statements is very blurred in javascript. Unlike other C-alike languages, you can have not only expressions in statements, but also statements inside expressions:

    a = 1 + function(x) { if(x > 1) return 10 } (20) 
    

    Some modern javascript programs, such as Jquery, use declaration techniques that basically make them one single expression.

    This blurry distinction (not to say confusion) comes from the fact that Javascript, being a C/pascal/algol-like imperative language, was at the same time heavily influenced by functional languages like Lisp, which don’t have a notion of “statements”. In a functional language, everything is an expression.

    To make things more interesting, the semicolon between statements is (sometimes) optional, so that there’s no easy way to tell if two expressions belong to one statement or form two distinct ones. Consider:

     a = 1  // two
     !2     // statements
    
     a = 1  // one
     +2     // statement
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started to learn Android development. My previous experience is majorly .NET framework
I have just started to learn Ruby (like 2 mins before) , searched on
I just started to learn Django and Python. I use the online book from
I just started to learn jquery and JavaScript so i can implement it with
I've just started trying to learn JS so apologies if this seems like a
i have just started to learn MVC 4 ASP.NET. I am using a tutorial
so I just started to learn JavaScript. When I click on Click Me!, my
Hi just started trying to learn a little javascript, now for my first programm
I started to make an really simple experiment, just to learn the basics of
I just started to learn Ruby and as a .Net developer, I'm wondering if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.