Introduction to Javascript
Javascript often abbreviated JS is a lightweight interpreted or just-in-time compiled programming language with great functionality. If you love movies, think about how a scriptwriter blows your mind with such thrills, drama, and logic. As well as you also can functionalize your web pages with your logic and thoughts. Because it is best known as the scripting language for web pages but it’s used in many non-browser environments as well.
The first-ever Javascript was created by Brendan Eich in 1995 at Netscape initially and further implemented by ECMA Company Limited. It has dynamic typing prototype-based object-oriented and first-class functions. It has application programming interfaces (API) for working with text, dates, regular expressions, standard data structures, and the document object module (DOM).
Javascript engines were originally used only in web browsers, but are now core components of some servers and a variety of applications. Node.js is the most popular runtime system for this usage.
The articles in this JavaScript Basic series are listed below.
- Javascript Basic – What is Javascript in the Programming World
- Javascript Basic – What is a Variable in Javascript
- Javascript Basic – What is an Operator in Javascript
- Javascript Basic – What is a Conditional Statement in Javascript
- Javascript Basic – What is Loop in Javascript
- Javascript Basic – How data type conversion is done
- Javascript Basic – What is String in Javascript
- Javascript Basic – How Array works in Javascript
- Javascript Basic – How to define Objects in Javascript
- Javascript Basic – How to define a function in Javascript
Javascript Features
- Object-Centered Script Language
- Client edge Technology
- Validation of user’s input
- Interpreter centered
- Built-in Functions
- Case sensitive format
- Lightweight and delicate
- Handling Events
- DOM Manipulation
Field of Applications
Web Development
Javascript is a client scripting language that is used for creating web pages. Javascript allows developers o create a dynamic and interactive web page to interact with visits and execute complex actions. Most websites use Javascript for validation and to support external applications n, including PDF documents, widgets, and flash applications.
Some famous sites built by the use of Javascript are Google, Youtube, Facebook, Wikipedia, and Amazon, to name a few.
Web Applications
There is some Javascript used for developing robust web applications. Popular Javascript front-end frameworks that help build web apps are React Native, React, Angular, and Vue. Netflix and Paypal were developed with AngularJs Javascript frameworks and Application Programming Interface (APIs).
Server Applications
Node Js is built on Chrome’s Javascript runtime for building fast and scalable network applications. It uses event-driven, lightweight, and efficient applications to be distributed over the system with the help of a server. Javascript is used to handle HTTP requests and generate content.
Web Server
Node.js allows developers to use Javascript to create a web server. Node.js being event-driven, it moves to the next call without waiting for the response of the previous call. The servers quickly transfer the data without buffering.
Game Development
JavaScript is a scripted language widely used for creating games. JavaScript and HTML5 together play an important role in the development of games. The EaselJS library provides rich graphics for games. HTML5 provides total access to the web without additional plugins like Flash. Complex browser games Tower Building, CrossCode, and HexGL game are based on JavaScript and HTML5.
Mobile Apps
JavaScript frameworks have been designed to facilitate mobile app development across various platforms like IOS, Android, and Windows. The most exciting thing is that apps can be developed for Android and iOS using a framework called React Native of JavaScript Language.
Environment Setup
To have fun with JavaScript, first, we need to set up the environment of JavaScript. We can run JavaScript in two ways.
- Using the Browser Console
- Node JS
Although there are some differences between the two, we can continue to work using picking anyone.
Browser
Enter Google Chrome and right-click anywhere on the page to get the Inspect option. Clicking here (Inspect) will usually open a panel at the bottom. Where we can execute directly by writing JavaScript.
For example:
console.log('Hello Enablegeek !!')
When we press the Enter key from the keyboard, we see “Hello Enablegeek !!” as output.
Node JS
Node JS will help us to run JavaScript outside the browser. For this, we first need to download the LTS version from this website (https://nodejs.org). Then you have to set it up like other tools. If you are a Windows user, you can use the operating system command window to run Node JS. Now in the command window, we will check with this “node -v” command whether Node JS is working properly. If Node JS is working properly then it will show which version is installed as output. If it doesn’t show, then Node JS is not installed properly.
To write a script we need a code editor so that we can write the script very easily and neatly.
The most widely used code editors are
- Atom
- Visual Studio Code
- Brackets