Exploring the Basics of JavaScript: An Introduction to the Language of the Web
If you want to be a developer, start with the most accessible skills: HTML and CSS. After HTML and CSS, what next? JAVASCRIPT. Yes, JavaScript is a programming language that will make what you have built with HTML and CSS function well. I am sure you wish HTML and CSS were programming languages, but they are not. JavaScript is one of many programming languages you must learn as a developer. The prerequisites to know JavaScript are HTML and CSS.
TABLE OF CONTENTS
Meaning of JavaScript
History of JavaScript
Why is JavaScript Important?
Uses Of JavaScript
Possible ways to write JavaScript
MEANING OF JAVASCRIPT
JavaScript (JS) is one of the most popular programming languages in the world. It is a computer programming language that makes websites and applications active and interactive. It’s unique because it can run directly in the browser, not just on a server. As of March 2023, 98.4% of all websites use JavaScript.
HISTORY OF JAVASCRIPT
Brendan Eich founded JS.
He developed JS in 1995.
He also developed the first JS Engine, Spider Monkey, which Mozilla Firefox still uses.
JS's name was later changed to ‘mocha’ and ‘LiveScript’, but it remains JS due to some trademark reasons.
WHY IS JAVASCRIPT IMPORTANT?
JavaScript is essential for the following reasons:
Speed - JavaScript tends to be very fast because it often runs immediately within the client's browser. So long as it doesn't require outside resources, JavaScript isn't slowed down by calls to a backend server. Also, significant browsers all support JIT (just in time) compilation for JavaScript, meaning there's no need to compile the code before running it.
Simplicity - JavaScript's syntax was inspired by Java's and is relatively easy to learn compared to other popular languages like C++.
Popularity - JavaScript is everywhere on the web, and with the advent of Node.js, it is increasingly used on the backend. There are countless resources to learn JavaScript. Both StackOverflow and GitHub show an increasing amount of projects that use JavaScript, and the traction it's gained in recent years is only expected to increase.
Interoperability - Unlike PHP or other scripting languages, JavaScript can be inserted into any web page. JavaScript can be used in many applications because of its support in different languages like Pearl and PHP.
Server Load - JavaScript is client-side, so it reduces the demand on servers overall, and simple applications may not need a server at all.
Rich interfaces - JavaScript can be used to create features like drag and drop and components such as sliders, all of which greatly enhance a site's user interface and experience.
Extended Functionality - Developers can extend web page functionality by writing JavaScript snippets for third-party add-ons like Greasemonkey.
Versatility - There are many ways to use JavaScript through Node.js servers. Suppose you were to bootstrap Node.js with Express, use a document database like MongoDB, and use JavaScript on the frontend for clients. In that case, it is possible to develop an entire JavaScript app from front to back using only JavaScript.
Updates - Since the advent of ECMAScript 5 (the scripting specification that JavaScript relies on), ECMA International has been dedicated to updating JavaScript annually. So far, we have received browser support for ES6 in 2017 and look forward to ES7 being supported in the future.
USES OF JAVASCRIPT
POSSIBLE WAYS TO WRITE JAVASCRIPT
We have three ways to write JavaScript, they are:
- Using the browser console tab: On your browser, press F12 (for Windows) or Cmd+option+J (for Mac) (for Google Chrome). This will open up your console where you can write your javascript code.
- Using Node.js: Node. js is not a framework. Instead, Node. js is a JavaScript runtime environment.
You can download Node.js at https://nodejs.org/en/download
- Adding the <script> tag within the body of the HTML in Vscode to summarize all the JavaScript code. Here’s an example of internal JavaScript with the <script> tag:
In conclusion, JavaScript is very important. It is very interesting to learn. I will suggest to newbies like me to keep practicing JavaScript and don't rush the learning process. We should have it at the back of our minds that consistency is an important way of learning JavaScript. Also, we should build projects that require little JavaScript so as to master what we have learned.