DEV Community

Awais Butt
Awais Butt

Posted on

Introduction to javascript

Javascript is the most popular programming language. JavaScript was invented by Brendan Eich in 1995, and became an ECMA standard in 1997. The language was initially called LiveScript and was later renamed JavaScript. When javascript was created it had another name called “Livescript”. At that time java was very popular so it was decided that positioning a new language “young brother” of java. But after some time javascript became so popular with its own specification called ECMAScript and now it has no relation with java.

Why Study JavaScript?

JavaScript is one of the 3 languages all web developers must learn

  1. HTML to define the content of web pages
  2. CSS to specify the layout of web pages
  3. JavaScript to program the behavior of web pages

Javacsript can be added in our html page using two ways
Internal javascript

We can add JavaScript directly to our HTML file by writing the code inside the tag. The <script> tag can either be placed inside the <head> or the <body> tag according to the requirement.<br> Example<br> <html><head></p> <script> console.log(“welcome to javascript”);



// html code


External javascript
We can write JavaScript code in other file having an extension .js and then link this file inside the tag of the HTML file in which we want to add this code.

Features of JavaScript

According to a recent study by Stack Overflow, JavaScript is one of the most popular languages ​​in the world.
With the development of browser technology and JavaScript migrated to the server via Node.js and other frameworks, JavaScript is able to do more.
*Here are a few things we can do with JavaScript
*

  1. JavaScript was created in the first place for DOM manipulation. Earlier websites were mostly static, after JS was created dynamic Web sites were made.
  2. Functions in JS are objects. They may have properties and methods just like another object. They can be passed as arguments in other functions.
  3. Can handle date and time.
  4. Performs Form Validation although the forms are created using HTML.
  5. No compiler or translator is needed.

Conclusion

Javascript is a lightweight and easy to use language.
JavaScript can be run on any operating systems and almost all web browsers.
You need a text editor to write JavaScript code and a browser to display your web page.

Top comments (0)