<script> Javascript </script>

What is Javascript,Features of JS, advantages of javascript, Limitations of JS, Top Companies using Js.

HTML, CSS, and Javascript are the core technologies of the World Wide Web. Now the main question arises. What is Javascript? What is Javascript used for?

Javascript is a high-level programming language that is used widely on the modern web. It is a client-side as well as a server-side language. It has a vast amount of features like dynamic programming, prototype-based object orientation, and first-class functions. The majority of the websites in the modern world are developed using javascript and the major web browsers use the javascript engine to execute it. Javascript helps in creating interactive web pages. It supports event-driven, functional, object-oriented, and prototype-based programming styles. Javascript greatly helps in DOM manipulation. It has flexible APIs for working with a variety of data types like strings, dates, arrays, regular expressions, etc. Syntax of javascript is also very simple and easy to learn. But don’t mistake javascript for java. Although, their names sound similar and their syntax is also quite similar, but they greatly differ in design.

Many famous javascript frameworks like AngularJS are used for developing single-page websites. Powerful Javascript libraries like ReactJS are useful while developing not only single-page websites but mobile applications also. Javascript has an important part in modern web development.

Table of Contents

  1. History of Javascript
  2. Features of Javascript
  • DOM Manipulation
  • Functions as First-Class Objects
  • Javascript as a Client-Side Language
  • Platform Independent
  • The Syntax is Similar to Java
  • Date and Time
  • Prototype-Based Object Model
  • Form Validation
  • Detecting the User’s Browser and OS
  • Ability to Create Functions in the Script

3. Javascript Frameworks and Libraries

  • AngularJS
  • ReactJS
  • Vue.js

4. Advantages of Javascript

5. Limitations of Javascript

History of Javascript

Javascript was created by Brendan Eich in 1995 while he was working at Netscape communication. The web was young at that time. The mosaic browser came out as the first popular web browser. The same people who worked in the development of NCSA’s Mosaic browser were now working with Netscape communication. They were building their own browser, the Netscape communicator. With more independence and money, they started working on the expansion of the web that gave birth to javascript.

It was realized that the web needed to be more dynamic and the future web should have animations, interactions, and other automation. It could all be done by DOM interaction and for DOM interaction, a scripting language was needed. But java was on the rise at that time. This new scripting language does not need to target big-shot developers. The web was purely static at that time. HTML was also young at that time and it didn’t need big-shot developers. So the people at Netscape decided, a simple scripting language can be helpful for making the web dynamic that even the non-developers could use. Then, the idea of Mocha was born.

The Sun technologies were contacted by Netscape to cut a deal to make java available in the browser. But java at the time was the only popular high-level language and needed well-skilled and experienced developers. Netscape wanted to target designers, scripters, and people with no experience of programming. Mocha was ideal for it. A simple scripting language for web and a companion of java. This is when Netscape hired Brendan Eich, also known as the father of javascript. Eich had the freedom to do what he likes but there was a lot of pressure on him. Other languages like python were also the candidates. He had to design a prototype as soon as possible. Eich started working on it and mocha’s first prototype was introduced in the Netscape communicator in 1995. Later that year, the deal between sun and Netscape closed, and mocha(also called LiveScript) was renamed to Javascript. At that time, javascript was only presented as a scripting language meant only for scripting work, while java was the original language for heavy and rich web development.

Features of Javascript

In the starting, the power of javascript was not known. Developers saw many flaws in the language. But as the web advanced, features of javascript became more useful. Developers soon realized that javascript was more than a scripting language.

The following are the features of javascript.

  • DOM Manipulation

The very reason why javascript was created is DOM manipulation. During the early time, the web was purely static. It was made dynamic by the introduction of Javascript. So what can javascript do with the DOM? a lot many things like changing all the HTML elements on the page and all their attributes. It can also change the CSS of every HTML element on the page. Javascript can add new elements in the page and remove the existing ones. It can also create new HTML events. DOM manipulation changed the web.

The following is an example of using javascript for DOM manipulation.

1. <html>
2. <body>
3. <button onclick="demoFunction()">click</button>
4. <p id="para1"></p>
5. <script>
6. function demoFunction()
7. {
8. document.getElementById("para1").innerHTML = "Hello World!";
9. }
10. </script>
11. </body>
12. </html>

In the body tag, there is one button tag used to create a button. Javascript is used to handle the button click event and when the button is clicked, “Hello world!” appears below it. This is DOM manipulation using javascript. Observe the code in the script tag. Inside the demoFunction, the getElementById method is used to access the id of a paragraph tag below. This is how “Hello world!” is added to the DOM dynamically.

  • Functions as First-Class Objects

Functions in javascript are objects. They can have properties and methods just like any other object. Functions can be passed as arguments in other functions. They can also be thrown as exceptions. This feature of javascript is widely popular. Functions as objects are very helpful in development.

1function function1(x) {2alert(x);3}4function function2(var1, callback) {5    callback(var1);6}7function2(2, function1);

In the above code, function1 along with value is passed as an argument in function2. In the function2, function1, now as callback, is used. This is how functions are passed in javascript.

  • Javascript as a Client-Side Language

Originally developed as a server-side, javascript is also used as a client-side language. This feature of javascript made it the primary language of the web. A developer does not need to learn different programming languages for server-side and client-side because javascript can be used as both.

  • Platform Independent

Javascript is a platform-independent language, which means it can run on Windows, Macintosh, Netscape-supported systems, and any other platform.

  • The Syntax is Similar to Java

Javascript was developed as a companion to java. Javascript was not intended to have similar syntax as java. But further development forced it to do so. This made it easier for developers who work in both languages.

  • Date and Time

Not many programming languages support ways for handling date and time. Javascript has inbuilt functions that easily handles dates and time.

  • Prototype-Based Object Model

In javascript, the objects have an internal property known as the prototype. These prototypes are a reference to other objects and contain common properties across all instances of the object. Prototypes are extremely useful for developers and ease their work. This prototype-based model made javascript greatly flexible and influenced many useful libraries such as Stampit.

The following code shows the use of prototypes in javascript.

1function Employee(firstName, secondName, age, employeeNumber) {2  this.firstName = firstName;3  this.lastName = lastName;4  this.age = age;5  this.employeeNumber = employeeNumberl6}7Person.prototype.nationality = "English";
  • Form Validation

Forms play a very important in the modern web. The form is created using HTML but that’s not everything. Form need validation for user inputs that is necessary. Javascript handles form validation and sends data to the server with very ease.

  • Detecting the User’s Browser and OS

Although Javascript can run on every platform, there could be a need for browser and os specifications according to the code. Javascript is capable of detecting the user’s browser and OS.

1<html>2<body>3<button onclick="demo()">Click</button>4<p id="para1"></p>5</body>6<script>7function demo(){8document.getElementById("para1").innerHTML = Hello world9}10</script>11</html>

The above HTML code has a script where a function is used

Javascript Frameworks and Libraries

In the modern world, web development frameworks and libraries are heavily used. Web frameworks are designed to support web application development. This includes web services, web APIs and web resources. The most famous web frameworks and libraries are developed using javascript. These include AngularJS, ReactJS, Vue.js, Meteor.js, Ember.js, Backbone.js and many more.

Let us check some of the Javascript libraries and frameworks.

  • AngularJS

AngularJS, being a full-fledged javascript framework, it is widely used in modern web development. It is very popular among web developers. AngularJS uses typescript, which is a superset of javascript. It has a variety of features like dependency injection, forms, templates, and more.

  • ReactJS

ReactJS is a powerful javascript library that is used widely for the user interface. Its core feature is its virtual DOM that makes DOM manipulation very fast as compared to other DOM manipulation frameworks

  • Vue.js

Vue.js is another popular javascript framework used for creating the user interface and single-page web applications.

Advantages of Javascript

Javascript is one of the core technologies of the World Wide Web. It is immensely popular because of its features. These features have many advantages that made javascript this popular.

  • Javascript provides dynamic programming that is heavily used in the modern web.
  • When used as a client-side language, Javascript is very fast as it runs immediately in the browser.
  • One does not need to master different languages for the client-side and server-side.
  • The javascript frameworks and libraries had made web development easy and straight-forward.
  • Javascript is very simple to learn as compared to other programming languages like java. Being one of the core technologies of the World Wide Web, resources for javascript are easily available online and offline.
  • Regardless of the file extension, We can insert javascript in any web page.
  • Javascript supports all modern web browsers.
  • Javascript provides extended functionalities to the web pages.
  • No compiler is needed in javascript.
  • Javascript is an event-based programming language.

Limitations of Javascript

There are a few limitations of javascript as well.

  • One of the biggest limitations of javascript is that the code is visible to everyone.
  • Javascript as the client-side does not allow the reading and writing of files.
  • There are no multithreading capabilities of javascript.
  • Javascript cannot be used for networking applications.
  • It can be disabled.

How 10 Major Companies Are Using JavaScript

There’s no denying that JavaScript is everywhere, but just how are some of the world’s largest tech companies using JavaScript? For these 10 companies, JavaScript is immensely important, and that doesn’t look like it’s going to change any time soon.

Microsoft

Okay, so you’re probably not going to find JavaScript powering Windows anytime soon, but Microsoft relies on JavaScript for a whole lot else.

First off, Microsoft needs to work closely with JavaScript to built its Edge web browser. All browsers need to process and execute JavaScript efficiently, so Microsoft has developed and maintains its own JavaScript engine for Edge. Actually, there has been talk of them creating an alternate version of NodeJS with the Edge engine.

Recently, Microsoft has really embraced NodeJS. They thoroughly support Node on the Azure cloud platform. Its one of Azure’s major features, and they’ve integrated Visual Studio support for Node.

Microsoft has also developed a version of Node for Internet Of Things(IoT) applications. NodeJS is great of IoT because it’s light weight and efficient.

PayPal

PayPal has obviously been using JavaScript on the front end of their website for a long time, but that’s only the beginning.

The online payment giant was one of the earliest adopters of NodeJS. During an overhaul of their account overview page, they decided to try building the page in Node at the same time as their usual Java development. The NodeJS version worked out so well, that they chose to use it in production and build all client-facing applications in Node going forward. That means that most of what you see in your account is running on Node.

PayPal even went as far as to create and maintain their own version of Express, called KrakenJS. It’s pretty obvious that they like JavaScript over at PayPal.

Netflix

Like PayPal, Netflix started out using Java for just about everything. They too ran into problems with Java’s size and the time it required to develop.

Over time, Netflix moved away from its more traditional structure into the cloud and started to introduce NodeJS. With Node, Netflix was able to break down pieces of their user interface into individual services. This more distributed approach was able to speed things up an alleviate stress on their servers. Today, a large portion of Netflix’s interface is running on Node.

Groupon

Groupon used to be infamously slow. Why? They were powered by Ruby on Rails. That’s the same framework that brought you the Twitter fail whale.

Groupon was all one gigantic Ruby on Rails application. Thanks to difficulties in speed and maintainability, they decided to change over to NodeJS. Node allowed Groupon to rebuild their entire US website by breaking down everything into individual NodeJS web applications. Now, Groupon is made up of over 20 Node applications, and it moves much faster as a whole.

Groupon is currently moving all of their international sites to NodeJS and has joined the NodeJS Foundation. It’s pretty clear that they are happy with their change.

Uber

Uber needs to handle loads of data in real time. They have millions of requests coming in continuously, and that’s not just hits on a page. Uber needs to track driver locations, rider locations, and incoming ride requests. It has to seamlessly sort that data and match riders as fast as possible.

All of that plays to NodeJS’s and JavaScript’s strengths. Node is designed to handle requests and hand off data quickly. It’s asynchronous capabilities are a huge part of that. Node is central to Uber’s user facing stack for just that reason.

Facebook

You’re probably aware that Facebook uses JavaScript. It’s kind of hard to miss. What’s probably not as obvious is exactly how much JavaScript goes into making Facebook and how much Facebook is involved in JavaScript development.

Try disabling JavaScript in your web browser and going to Facebook. The website will actually stop you from logging in because it won’t work without JavaScript.

You may have noticed the way that Facebook loads. Each piece of the page is separate. Facebook has invented its own way of breaking down and delivering sections of JavaScript separately. In an odd way, each section of your Facebook page is a collection of independent JavaScript applications.

It doesn’t stop there. Facebook created React, one of the most popular front end frameworks. Facebook uses React on Facebook.com as well as Instagram and WhatsApp.

Google

How doesn’t Google use JavaScript? Seriously, it’s everywhere. Google’s search results that spring up as your typing get there with JavaScript. The Gmail web client is powered by JavaScript. Google Docs? Yeah, that’s JavaScript too.

Google develops and usually open sources it’s own JavaScript tools. The most obvious example is AngularJS. Angular is used most prominently in Google’s DoubleClick advertising platform, but it’s also one of the most popular front end frameworks available. It’s even part of the MEAN stack.

Google’s more intensive services, like Google Docs, use Closure Tools. This set of tools compiles JavaScript into a lower-level faster form more suited for rich and highly responsive web applications.

There’s another big point to touch on. Google developed Chrome. Chrome, being a web browser, needed a JavaScript engine, so Google also made V8. V8 not only powers Chrome, it’s at the heart of NodeJS. So, without Google, there would be no Node.

eBay

eBay’s story is a lot like Netflix’s. For a long time, just about everything in eBay’s tech stack was based on Java. A few years ago, eBay encountered a problem that Java wasn’t the right solution for. They decided to give NodeJS a shot instead.

Node worked so well that eBay not only kept using it for that particular service, they began migrating their entire user facing stack to NodeJS. Now, just about everything that you interact with on eBay is powered by Node. Sure, beneath Node, Java is still dealing with their databases, but eBay still places a lot of trust in NodeJS.

Walmart

Most people probably don’t think of Walmart as a tech company, but because they’re one of the largest retailers in the world, their online retail business is gigantic. It’s not much of a stretch to see how they need build a technologically advanced web application do drive their online business.

Walmart started out with Java. It’s a solid enterprise-grade platform that has been the de facto choice for years. However, Walmart needed something faster and lighter weight for their mobile site. So, they turned to NodeJS.

Once again, Walmart began to see Node as a valid Java replacement in loads of other places. Today, the Walmart.com that you see is powered by Node. NodeJS was also the ideal choice for other web applications within their marketplace that require multiple users to be able to access management interfaces simultaneously.

LinkedIn

LinkedIn relies on NodeJS for its mobile site. A few years back, LinkedIn used Rails for its mobile site. As with other other large Rails applications, it was slow, monolithic, and it scaled poorly.

LinkedIn switched over to NodeJS to solve its scaling problems. Node’s asynchronous capabilities allowed the LinkedIn mobile site to perform more quickly than before while using fewer resources. Node also made data sharing and building APIs easier for the LinkedIn developers.

Conclusion

Javascript is often described as the most disliked language. It was poorly designed. But it was not intended to be what it is today. From just a server-side language under the shadow of java to one of the core web technologies of the World Wide Web, javascript has covered a long distance. It is used as server-side as well as client-side. Features of javascript are useful, yet complicated. Many languages came and diminished but javascript is still here and it will remain here for a long time, probably forever.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store