Let’s take an example of Student Management Software.
What kind of variables do we require to store information?
Normally you can define any name for a variable but you need to be a little bit careful about a variable name. For example, if you want to declare Gender variable then don’t just write G or g, it would be very difficult to understand code for a new person when the application complexity level gets increases.
Another thing, when you declare a variable, use camel case formate. It’s a standard way to define variable name across various programming languages.
Variable Declaration Example
// Wrong way (Camel case not used) let StudentName = "Garry"; // Right way (Using camel case) let studentName = "Jack"; // Declare multiple variable (Not convenient way if type is same) let studentName = "Jack"; let studentAddress = "USA"; // Declare multiple variable (Convenient way if type is same) let studentName = "Jack", studentAddress = "USA"; //OR let studentName = "Jack", studentAddress = "USA";
let studentName = "Jack", studentAddress = "USA"; console.log(studentName, studentAddress);
See output here in the console window by pressing F12.