By: Harshal Patil
JavaScript is a text-based programming language used both on the client-side and server-side that allows you to make web pages interactive. Where HTML and CSS are languages that give structure and style to web pages, JavaScript gives web pages interactive elements that engage a user.
<html>
<head>
<title>Document</title>
</head>
<body>
<!-- linking app.js file -->
<script src="app.js"></script>
</body>
</html>
A JavaScript Variable
is simply a name of storage location. There are two types of variables in JavaScript : local variable and global variable.
There are some rules while declaring a JavaScript variable (also known as identifiers).
In this example, these are variables, declared with the var
and let
keyword:
If you want a constant variable: always declare variables with const
.