Skip to content

Commit ce52b20

Browse files
Update 02_.md
1 parent b4258bf commit ce52b20

File tree

1 file changed

+1
-1
lines changed
  • 02_Data Types and Variables/00_Data Types/02_JavaScript Data Types

1 file changed

+1
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
As shown in the sample code above, there are many data types and ways to declare a variable. The variable `count` holds an integer data type in the first line, but is assigned to a string data type in the second line. This is allowed in JavaScript as all variables can hold any data type. Other data types including float (basically int but with decimals), as well as boolean (either true of false). The `const` keyword is only used when we want to create a constant that will not change in the program. This is the reason why `MAX_COUNT = 0;` is commented in the program. Removing the comments will cause an error as the value of the constant `MAX_COUNT` cannot be changed after it is declared
1+
As shown in the sample code above, there are many data types and ways to declare a variable. The variable `count` holds an integer data type in the first line, but is assigned to a string data type in the second line. This is allowed in JavaScript as all variables can hold any data type. Other data types including float (basically int but with decimals), as well as boolean (either true of false) hold only specific data types. The `const` keyword is only used when we want to create a constant that will not change in the program. This is the reason why `MAX_COUNT = 0;` is commented in the program. Removing the comments will cause an error as the value of the constant `MAX_COUNT` cannot be changed after it is declared.

0 commit comments

Comments
 (0)