Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Comments in JavaScript

  • /*
  • //
console.log("code 1");
// comment

console.log("code 2")
/* more
   comment
*/

console.log("code 3")

// console.log("/* hello */")

console.log("code 4")
  • To explain to the next developer why do we do something.
  • Explain algorithm.
  • Temporarily disable code for debugging.