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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:18:10+00:00 2026-05-29T09:18:10+00:00

So his help site states that All statements, including function declarations, must be correctly

  • 0

So his help site states that “All statements, including function declarations, must be correctly terminated with semi-colons.”

But in this sample code, he specifically say not to end the if statement in semicolon.

So is there a complete list of what should be ended with a semicolon? I was looking at my Javscript code and here are some cases I wasn’t sure was proper format for the packer:

1)

for( i in cities ) {
    alert( i );
};

2)

var map = {
    city : 'atlanta',
    year : 1987
};

3)

var info_window = new google.maps.InfoWindow( {
    content : content_div,
    zIndex  : INFO_WINDOW_Z
}; );

4)

var options = {
    business : business,
    columns  : [ 'url', 'image_url', 'expiration', 'percent_discount', 'claimed', 'fine_print' ];
};

5)

$( warp_content ).hover( function() {
    $( deal_description ).fadeIn( 'fast' );
};, function() {
    $( deal_description ).fadeOut( 'fast' );
}; );
  • 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-29T09:18:11+00:00Added an answer on May 29, 2026 at 9:18 am

    There are rules, but sometimes they may not be obvious. Essentially, the following statements do not need terminating semicolons:

    • if (...) { }
    • for (...) { }
    • while (...) { } (except in do { } while (...);)
    • function (...) { } (except for examples such as var f = function() { }; where an anonymous function is part of a larger statement)
    • try { } catch (...) { }
    • with (...) { }

    Essentially, anywhere { } surrounds a group of statements, that is a block and no terminating semicolon is required.

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

Sidebar

Related Questions

I am trying to help a friend of mine break his site out of
In his PDC talk, Anders said that the dynamic keyword would dispatch any function
One of my clients ask to do some customization in his site. That site
I am trying to fix an error for a friend in his site that
Any help is appreciated. When using cfimage to generate a captcha, we keep his
I have a colleague who insists that his code doesn't need comments, it's "self
I have .net mvc3 web site. And i must to implement top menu. Each
A Drupal site a friend has on my server (WHM/CPanel) show his menu navigation
Yo my friends having a coding error with his site, and asked me for
Just a quick question. I am trying to help a friend with his website.

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.