GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javascript/basics/comments.md at master · viijayscript/javascript

Expand file tree

/

comments.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
47 lines (32 loc) · 922 Bytes
/

comments.md

Copy path

File metadata and controls

47 lines (32 loc) · 922 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

Comments

Comments are statements that will not be executed by the interpreter, comments are used to mark annotations for other programmers or small descriptions of what your code does, thus making it easier for others to understand what your code does.

In Javascript, comments can be written in 2 different ways:

  • Line starting with //:
// This is a comment, it will be ignored by the interpreter
var a = "this is a variable defined in a statement";
  • Section of code starting with /*and ending with */, this method is used for multi-line comments:
/*
This is a multi-line comment,
it will be ignored by the interpreter
*/
var a = "this is a variable defined in a statement";

Mark the editor's contents as a comment

Mark me as a comment
or I'll throw an error
/*
Mark me as a comment
or I'll throw an error
*/
assert(true);

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.