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 847365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:46:18+00:00 2026-05-15T06:46:18+00:00

I just watched a video of Douglas Crockford’s presentation about his 2009 book JavaScript:

  • 0

I just watched a video of Douglas Crockford’s presentation about his 2009 book JavaScript: The Good Parts.

In the video, he explains that the following block is dangerous because it produces silent errors:

return
{
    ok: false
};

And that it should actually be written like this (emphasising that although seemingly identical the behavioural difference is crucial):

return {
    ok: false
};

You can see his comments around 32 minutes into the video here: http://www.youtube.com/watch?v=hQVTIJBZook&feature=player_embedded#!&start=1920

I have not heard this before, and was wondering if this rule still applies or if this requirement in syntax has been overcome by JavaScript developments since this statement was made.

I found this very interesting as I have NOT been writing my code this way, and wanted to check that this information was not out of date.

  • 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-05-15T06:46:18+00:00Added an answer on May 15, 2026 at 6:46 am

    The silent error is that undefined is returned!

    Semicolons are optional in JavaScript, and therefore

    return
    {
        ok: false
    };
    

    is parsed as if it were

    return;  // Leaves function straight away
    {
        ok: false   
    };
    

    JSLint will recognize such patterns and warn about them:

    lint warning: unexpected end of line; it is ambiguous whether these lines are part of the same statement

    lint warning: missing semicolon

    lint warning: unreachable code

    lint warning: meaningless block; curly braces have no impact

    This has been discussed on SO in the “Strangest language feature” question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just watched a video about unit testing WebOS applications and they used the
I just watched this funny YouTube Video about unit testing (it's Hitler with fake
I just watched a session of PDC09 about new features of Entity framework in
I just watched a 2011 WWDC presentation on Implementing UIViewController Containment ( here's a
I have recently watched a video of Nicholas Zakas talk about high performace scripts.
A few days ago, I watched the video tutorial which explains how to use
I just watched a video regarding the Report Designer. It said to go to
I've just watched this video showing off an app: https://www.youtube.com/watch?v=2qM3Zps_0pE&feature=player_embedded At 3:34. How in
I just watched Google Wave Keynote video on Google I/O and I must say
I just watched a Google tech talk video covering Polyworld (found here ) and

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.