## Hello People!
In the previous post, we have started many programming tutorials, We have learned some basics of C++ and node.js with the help of some projects like discord bot, Hive Account details showing bot and much more. But before we jump in all those we need to start learning from very basics and we need to move slowly and step by step. So that's why I felt that I should start JavaScript from the very beginning and learn step by step. From now on we will learn a single topic in a single post because of programming needs practices when you learn a thing here you will need to practice it in order to remember it for the long term. So let's start our first JavaScript tutorial.
## What is JavaScript.
``To learn coding JS we need to understand JavaScript first so JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat. JavaScript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles. Javascript is used by well-known companies like Google, Youtube Gmail, Wikipedia and many more.``
# Today's Topic.
In the post, we will cover JavsScript Variables.
## JavaScript Variables.
Variables in a programming language are used to store value. We use variables to values like string data, numeric, Floating, etc. The data stored in the variable can be called just by calling the variable. For Example, We want to display a message "Hello World" on console 5 times then instead of writing the whole string "Hello World" We can assign this string to a variable and then we will just need to call that variable. We can use a loop for displaying repetition but the loop is not our topic for now. Let's understand the variables with the help of coding.
* Let's open Visual studio code.

* To run our script we will need to HTML. so let's write a basic HTML syntax. If you are using VS code just like me then write ``!`` and click enter.

* Now click Enter.

* Let's create a variable and assign some string value to it. But we will do it inside the script tag.

* We will create a variable with name text and assign "This is hive tutorial by pakgamer" to it.

* Now let's call the variable in the alert.

* Let's run the script by clicking mouse right-click and then click on run with live server.


* And you can see the message assigned to the variable in the alert box.
* One more thing I want to tell you that the value of a variable can be changed. A VAR or LET variables are not content it means that its value can be changed. Let's change its value for the sake of example.

* As we can see in the above pic the value the variable is changed. Now let's change the variable type to const and then see what happens.

* Nothing is displaying on the screen.

* let's inspect why the page is blank.


* As we can see that the console is telling us that we are changing the value of a constant variable which is not possible.
* Next thing is a local variable and global variables. So just like its names local variable can be accessed within the function in which it is defined and global variables can be accessed globally.
### Script.
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
const text="This is hive tutorial by pakgamer"; // Constant variable. so its value cannot be changed
var text1=" Hive post ";
text="this is new message"; //CHECKING IF ITS VALUES CHANGED
text1="new text"; // Assigning new value to the pervios define variable
alert(text);
</script>
</body>
</html>
```
That's all for today. Take care.