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

  • SEARCH
  • Home
  • 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 750987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:36:51+00:00 2026-05-14T14:36:51+00:00

Many times I’ve seen a semicolon used after a function declaration, or after the

  • 0

Many times I’ve seen a semicolon used after a function declaration, or after the anonymous “return” function of a Module Pattern script. When is it appropriate to use a semicolon after curly braces?

  • 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-14T14:36:52+00:00Added an answer on May 14, 2026 at 2:36 pm

    You use a semicolon after a statement. This is a statement:

    var foo = function() {
      alert("bar");
    };

    because it is a variable assignment (i.e. creating and assigning an anonymous function to a variable).

    The two things that spring to mind that aren’t statements are function declarations:

    function foo() {
      alert("bar");
    }

    and blocks:

    {
      alert("foo");
    }

    Note: that same block construct without semi-colon also applies to for, do and while loops.

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

Sidebar

Related Questions

Many times I've seen links like these in HTML pages: <a href='#' onclick='someFunc(3.1415926); return
Used this script many times to pass 1 or 2 values to a PHP
Many times, I'm writing a function which will return true on success and false
Many times I have seen Visual Studio solutions which have multiple projects that share
Many times I use 'mqsc' for create MQ queue manager from script files but
How many times have we seen this type of selector: List Box Selector http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/MoveItemsListBox.jpg
Many times I have seen code where they write a Class like this: public
How many times is it permitted to have the jQuery document ready function declared
I have seen many times that android recommends to choose lower version to create
I have seen many times in htaccess these type of rules : RewriteCond %{HTTP_REFERER}

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.