You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cheatsheet/basics.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ JavaScript provides seven different data types:
34
34
35
35
## Variables
36
36
37
-
In JavaScript, you can declare variables using `var`, `let`, and `const` keywords. Here's what you need to know about each:
37
+
You can declare variables using `var`, `let`, and `const` keywords. Here's what you need to know about each:
38
38
39
39
1.`var`: This is the oldest way to declare variables. It's not used as much in modern JavaScript, but it's still important to understand. Variables declared with var are function-scoped, meaning they are only available within the function they're declared in.
40
40
@@ -351,7 +351,7 @@ These operators are less commonly used than the arithmetic, assignment, comparis
351
351
352
352
## Comments
353
353
354
-
In JavaScript, you can write comments in your code to explain what it does, leave notes for yourself or others, or to prevent execution of code. There are two types of comments in JavaScript:
354
+
To write comments in your code to explain what it does, leave notes for yourself or others, or to prevent execution of code:
355
355
356
356
### Single-line comments
357
357
@@ -383,7 +383,7 @@ It can span multiple lines
383
383
384
384
## The console.log Function
385
385
386
-
The `console.log()` function in JavaScript is used to print output to the console. This can be very useful for debugging, as it allows you to output the values of variables at different points in your code, or to output messages that help you understand the flow of execution in your code.
386
+
The `console.log()` function is used to print output to the console. This can be very useful for debugging, as it allows you to output the values of variables at different points in your code, or to output messages that help you understand the flow of execution in your code.
387
387
388
388
```javascript
389
389
console.log("Hello, World!"); // prints "Hello, World!" to the console
@@ -412,4 +412,3 @@ console.log(a, b); // prints "1 2" to the console
412
412
Note that `console.log()` does not affect the execution of your code. It's purely for outputting information to the console.
0 commit comments