Learn javaScript : Variables (Part 2)
Today's article will focus on variables in JavaScript, where we would look at the various ways or options available in creating a variable with this amazing programming language. Variable in computer programming is a container that holds data, this data can mostly be of any type which helps in developing the logic for a particular function. Variables in JavaScript can hold integers, strings, functions, classes, and boolean values. Do not worry if you do not understand these things, we will focus on them later on in this series. Kindly study the following Part in case you had skipped it. JavaScript Introduction Ways of declaring a variable in JavaScript There are four (4) ways of declaring a variable; 1. Using the var keyword to declare a variable. sample code var x = 2; // output 2 2. Using the let keyword to declare a variable. sample code let y = 3; // output 3 3. Using the const keywo...