2. What is JavaScript?
JavaScript is a programming language that brings interactivity to our sites and custom
behaviors. It is a client-side scripting language which means that like other programming languages
do, it runs on the user’s computer and not on the server. This also means that it is based on the settings
and capabilities of the browser. It may not even be available because a user has chosen to turn it off or
because a device doesn’t support it, which good developers should keep in mind and plan for. In
addition, it is also referred to as a dynamic and loosely typed programming language.
It is a dynamic language because of what you see on paper when you review the code is not
the outcome that you will get when you run the code in the browser. This is because JavaScript uses a
data structure that is loosely typed, which means you can use all of the declarations (var, const, let)
without defining the type of variable.
Data in JavaScript is typed loosely, meaning we do not automatically tell JavaScript what a
variable is. We don’t have to programmatically define that variable as a number if we set a variable to
a value of 7, then JavaScript automatically recognizes it as a number.