Skip to content

Commit 92d1f33

Browse files
committed
Using comment to explain the information contain in the file, useful only for developers
1 parent fc159be commit 92d1f33

File tree

1 file changed

+29
-2
lines changed
  • Sprint-1/2-mandatory-errors

1 file changed

+29
-2
lines changed

Sprint-1/2-mandatory-errors/0.js

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
1-
This is just an instruction for the first activity - but it is just for human consumption
2-
We don't want the computer to run these 2 lines - how can we solve this problem?
1+
// This is just an instruction for the first activity - but it is just for human consumption
2+
// We don't want the computer to run these 2 lines - how can we solve this problem?
3+
4+
/** If you have lines that are just instructions or notes for humans and you don’t want the computer to execute them, you can turn them into comments.
5+
6+
In JavaScript, there are two ways to write comments:
7+
8+
1. Single-line comment
9+
10+
Use // at the start of a line.
11+
Everything after // is ignored by the computer.
12+
13+
Example:
14+
15+
// This line explains what the code does
16+
const num = 8;
17+
18+
2. Multi-line comment
19+
20+
Use \ /* ... *\ / to wrap several lines.
21+
22+
Example:
23+
This section is just instructions
24+
The computer will ignore everything between these symbols
25+
26+
const num = 5;
27+
28+
*/
29+

0 commit comments

Comments
 (0)