💬 Different types of comment
Comments in JavaScript are used to add notes, explanations, reminders, or hints within the code to make it easier for developers to understand and maintain. They help explain the purpose of code without affecting its functionality, as the JavaScript engine completely ignores comments during execution.
⚡️ Single-line comments
A single-line comment starts with two forward-slashes characters (//). It turns all the text following the // on the same line into a comment. For example:
// this is a single-line comment🔅 Multi-line Comments (Block comments)
A delimited comment begins with a forward slash and asterisk /* and ends with the opposite */ as in the following example:
/* This is a block comment
that can span multiple lines */