Introduction To JavaScript
The 2nd most popular programming language in the world today
Hello! My name is Grace, a freelance backend developer(Django) and a graphics designer.
Going by how technology is revolving, JavaScript has become a must learn skill for every software developer and that is one the reasons I was inspired to walk you through the basics of JavaScript in a manner as simple as possible, in order to prepare you to work with any JS framework in the nearest future. I really do hope you find this series helpful for you.
WHAT INSPIRED ME?
I was inspired to start this JavaScript Beginner's Guide series because I know there are so many aspiring developers out there who will want to learn JavaScript sooner or later in a way that will be very easy as possible for easy comprehension and also, for current developers who might have forgotten some basic knowledge in JS in a way or the other. Interestingly, I am learning JavaScript for the first time, so, I will be updating this series accordingly based on what I have learnt and I will make sure to compress a large amount of information into a single idea. One good way to have an in-depth knowledge about a subject is to teach others.
So, let's get started😊
PART 1:
WHAT IS JAVASCRIPT?
JavaScript is a high level programming language that is primarily used to make web pages dynamic and interactive. Instead of just sit there, watch a web page do nothing(static), JavaScript engages a user by providing interactive elements that can allow a user communicate with the web page.
HISTORY OF JAVASCRIPT
JavaScript was developed by Brendan Eich in 1995 in just 10 days. It was originally called Mocha, soon after, it was named LiveScript and later, JavaScript.
ECMA
ECMA is an acronym for European Computer Manufacturers Association. This body is in charge of maintaining the standard of JS. ECMA decides if any modifications or changes will be added in JS or not, if these changes get added, it will be tagged as new update and it will be released in the latest version of JS.
JS DEVELOPMENT TOOLS
For us to write a JS application or program we need some tools to work with. These tools simply include:
- a text editor(VS code, Sublime text etc)
- a browser(Google chrome, Mozilla Firefox, etc).
The Console in any of these browsers can be used in executing JS codes and also for debugging purpose.
DIFFERENT PLACES WE CAN TYPE IN OUR JS CODES
JavaScript codes can be written in the following places:
a. CONSOLE
- Open your browser
- Press ctrl+shift+i to open the console page
- Type in JS codes
b. SCRIPT TAG
Writing JS code in a HTML is totally allowed but, it must be enclosed with the Script tag as demonstrated below.
<html>
<head>
<title>Demonstrating script tag</title>
</head>
<body>
<script type="text/javascript"> console.log("Hello World") </script>
</body>
</html>
c. EXTERNAL JAVASCRIPT FILE
This is basically writing JS codes in a separate file that can be linked with a HTML file using script tag. This is the most efficient way as it makes our code short, organized, easy to understand and most importantly, it enforces reusability as we can link the same JS file to more than one HTML page.
Example: Let's say we have a file named "index.js" and in it we have
console.log("Hello World")
We do not have our "index.js" code enclosed with the script tag because we are working directly on a JavaScript file
then we can link the above "index.js" file to the HTML file below like this:
<html>
<head>
<title>Linking external JS file</title>
</head>
<body>
<script type="text/javascript" src="index.js"> </script>
</body>
</html>
In JS, the command, console.log, is used to print a value on the page of the browser's console, we will discuss more on this later in this series.
I will stop here today and forge ahead in my next post on the series. I hope you enjoyed reading this??😊
Bye👋