Part 01: Notes on JavaScript
Basics
Visite: 10xTech Infinity
1. [Link]
The [Link]() function is used to print output to the console. It's commonly
used for debugging and displaying information.
[Link]("Hello World");
2. "use strict"
The "use strict"; statement enables strict mode in JavaScript. It helps catch
common coding errors and prevents the use of certain error-prone features.
3. Variables
Variables are used to store and manage data in JavaScript. They can be declared,
used, and changed as needed.
Declaring a variable:
var firstName = "MANOJ KUMAR";
Using a variable:
[Link](firstName); // MANOJ KUMAR
Changing a variable's value:
Part 01: Notes on JavaScript Basics 1
firstName = "BCA PATHSHALA";
[Link](firstName); // BCA PATHSHALA
4. Variable Naming Rules
Cannot start with a number (e.g., 1value is invalid, but value1 is valid)
Can use underscore (_) or dollar symbol ($) (e.g., first_name , $firstname )
Cannot use spaces
Convention: Start with a small letter and use camelCase (e.g., firstName )
Examples of valid variable names:
var value1 = 10;
var first_name = "Manoj";
var _lastname = "Kumar";
var first$name = "Rohit";
var $firstname = "Jain";
5. Variable Naming Conventions
Snake case: first_name
Camel case: firstName (recommended for JavaScript)
These notes cover the basics of using [Link], strict mode, variable
declaration, usage, and naming conventions in JavaScript.
Part 01: Notes on JavaScript Basics 2