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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:40:26+00:00 2026-06-12T02:40:26+00:00

Are comments literally just stripped out of your source before parsing, or can they

  • 0

Are comments literally just stripped out of your source before parsing, or can they count as linebreaks and disrupt continuity in certain contexts?

'foo'.replace(/f/, 'b') //f->b
     .replace(/o/, 'a') //o->a
     .replace(/o/, 'r') /*o->r*/ ;

'foo'.replace(/x/, /*matches "x"*/ 'y');

var foo = ( true !== false ) ? // bikeshed
          'bar' : /*if they're equal, which they won't be, we'll want 'baz'*/ 'baz';

You know, cause they say whitespace is “safe” and “insignificant” or whatever, but we all know there are exceptions to that. Are comments actually safe?

  • 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-12T02:40:27+00:00Added an answer on June 12, 2026 at 2:40 am

    They’re ignored during parsing, if they were stripped out before parsing, the parser would need to scan the input twice.

    However, the LineTerminator at the end of the line is not considered
    to be part of the single-line comment; it is recognised separately by
    the lexical grammar and becomes part of the stream of input elements
    for the syntactic grammar. This point is very important, because it
    implies that the presence or absence of single-line comments does not
    affect the process of automatic semicolon insertion

    ES5 Specification for comments.

    The source code is tokenised as if the comments didn’t exist.

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

Sidebar

Related Questions

I got two tables: comments and commentLikes in the same query i count the
Why are comments different colors in different programs? Is it just aesthetic or is
QUESTION ANSWERED IN COMMENTS Because of my reputation, I can't answer it in the
While in C++/C mode, Emacs 23 colors source code comments in bold red. Strings
Rolling comments inside a log4net file. Is it possible to roll the data inside
I have these tables: comments uid id pid pages pid user users id rank
I have Comments for something and it's possible to like them. The likes are
I have included Django comments framework in my project, and added custom templates to
In the comments on this answer , Remou writes that CurrentDB.Execute insert sql here
I use the django comments from contrib and I have an object (entry) that

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.