Storing Information in Variables – JavaScript Basics

Every application needs to be store information and the way we do that in JavaScript or in most programming languages is with variables. We have started with uses of Javascript. Now, we will explore more into javascript features. We are starting this tutorial with Variables.

Storing Information in Variables - JavaScript Basics



Let’s take an example of Student Management Software.

What kind of variables do we require to store information?

Name, Age, Class, Gender and so on. Each and every variable has its own type in JavaScript. We will discuss types in upcoming articles. Let’s just concentrate on variables for now.

Variable Naming Conventions in JavaScript

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

Working Example of JavaScript Variables

See output here in the console window.

We have learned how to declare variables in JavaScript. In the upcoming articles, we will see more on JavaScript basics.

Tutorial Funda

Tutorial Funda will keep you updated with the latest Programming Languages, Software Tools and related technologies used in Software Development.

Leave a Reply

Your email address will not be published. Required fields are marked *