Types of Initializing Variable
var roll;
roll = 101; var roll = 101; roll = 101;
var name;
name = “devopsschool.com”; var name = “devopsschool.com”; name = “devopsschool.com”;
price = 125.36;
Initializing Variable var price = 125.36; price = 125.36;
Whatever happens, is optional so only you roll = 101; can also write. Var is not necessary but if you use this is a good practice.
Rules of Initializing Variable
- Strings are written inside double or single quotes.
- Numbers are written without quotes.
- If you put a number in quotes, it will be treated as a text string
Initializing Variable
var ans = true;
var result = false;
Initializing Variable example
var x = 10, y = 20, c = 30;
var fname = “DevOps”, lname = “School”;
var name = “DevOpsSchool”, roll = 101;
var name = “DevOpsSchool”,
roll = 101,
address = “Steel City”;
Latest posts by rajeshkumar (see all)
- AWS Error: Access denied by EC2 Instance Connect - December 4, 2023
- How to get Blackduck Trial version? - December 3, 2023
- PHP ionCube Error: cannot be decoded by this version of the ionCube Loader - December 2, 2023