What is JavaScript?

In my early days as a web developer, I spend hours in front of my computer and think that what is JavaScript? and why we need it? when we can do most of the things through CSS and HTML.

I know this is the most absurd thing I have ever thought of but I think questioning myself was the only thing that motivated me to learn more. So, I did some research found out that JavaScript is used to make web pages more interactive for the user while HTML and CSS are used for the structure and styling. If you are curious like me then let’s dive deeper to understand “What is JavaScript?” and “Why we need it? ”

JavaScript is a scripting language which was introduced to make web pages alive”

JavaScript is Java?

Before learning Javascript the very question that comes into our mind is “JavaScript is Java?”.It happens to every newbie who has learnt or has listened about Java. When I was in my college I was keener on learning Java until I took my Web development course and I always think that javascript is java because it contains the word java in it but when I took web development seriously then it was revealed to me that both are two different languages. In fact, the actual name of Javascript was “LiveScript” back in the early days but at that times Java was at its peak in the market so it was decided to get benefit from the popularity of Java and make JavaScript the younger brother of Java.

But as time passed Javascript became a fully independent programming language with its own specification known as ECMAScript and now Javascript has nothing to do with Java.

Evolution of JavaScript

These days Javascript has become one of the most popular languages. It is so popular among web developers that 97% of websites use JavaScript. Today JavaScript can be run on any device which supports a special program called the JavaScript Engine. It can be run on the browser or on a server. Following are the Javascript Engines embedded on various browsers.

  • V8 in Chrome, Opera, Edge.
  • SpiderMonkey in Firefox.
  • Some others are like Chakra, SquirrelFish, Nitro etc.

Is JavaScript a secure language?

In Today's world, everything is getting online which in turn increase the security risks. Talking of online security raises the question that “How much JavaScript is secure?”.

Javascript is considered a safe programming language because it doesn't provide access to the system’s CPU or Memory because it was initially designed for browsers.

What in-browser JavaScript can do?

In browser, JavaScript can do everything related to web page manipulations, user interaction and the webserver. For instance

  • Add Tags, change styling, modify content.
  • JavaScript also provides functionalities that make users interact with the computer with his/her mouse or keyboard.
  • Javascript can send requests to the remote servers, upload or download the files.
  • It can manipulate user side data known as local storage.
  • It makes developers work with cookies.

What in-browser JavaScript can’t do?

JavaScript also has some limitations like other programming languages. It is limited to keeping its users safe from an evil webpage from accessing private information or manipulating users data.

Following are some examples

  • Javascript has nothing to do with the OS of the system so that a webpage cannot read/write files stored in the hard disk or make a copy of those files.
  • The webpages are not allowed to access users camera or mic until and unless the user explicitly permits them to do so.
  • Browser is only allowed to work on a file if the user performs some actions like attaching a file.
  • Browser tabs/windows do not know about each other but there are times when they are required to open a new tab i.e: opening a link in a new tab. But even in this case, 1 tab cannot manipulate the other tab/window.
  • It can make request calls over the internet to the server but even in this case also its ability to access another tab using the URL is crippled.

5 things that make JavaScript great

  • JavaScript requires no setup it is builtin in the browsers so beginners start right off. and see results of what they are coding.
  • It is highly compatible with HTML and CSS.
  • It has a huge community.
  • Easy to learn for beginners.
  • It is an incredibly expressive and powerful language.

Languages based on JavaScript

Everyone has his/her own likings and dislikings some like the syntax of the JavaScript easy to understand but some don’t just keep everybody happy a bunch of new languages have appeared which are converted to JavaScript before they run in the browser.

Following are some examples of such languages

  • CoffeeScript is a Syntactic sugar for JavaScript. It allowed users to write shorter scripts by making the syntax shorter allowing us to write much simpler code.
  • TypeScript is one of the most popular languages which is getting hype in the market. It introduces “strict data typing”.
  • Flow was developed by Facebook. It also added Data typing like previous languages like Java.
  • Dart is developed by Google. Although it is a standalone language it can be transpiled to JavaScript.
  • Kotlin is a modern programming language that can target the browser.
  • Brython is a JavaScript transpiler which meant to transpile Python to JavaScript.

Conclusion

JavaScript is a programming language meant to work on browsers but in modern days JavaScript can be used on any device which is compatible with JavaScript Engine. It is totally compatible with HTML and CSS. It allows us to manipulate the DOM (Document Object Model).

This is a brief introduction to JavaScipt and there is a lot more to learn about JavaScript.The main reason for writing articles about JavaScript is to make it easy for many new developers to try hard to learn more and land their dream job and make their lives better. If you want to get along with me on this journey then please subscribe. Thanks for reading. Happy coding!

--

--

--

A Web-developer with a vision to help other people of the world and advise them how they can become a better web developer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to create a Sticky Header in React Native and React Navigation

Sharing React components using Bit — a quick guide

Bad Go: Adventures with JSON marshalling

How to Convert String to JSON

2 steps to plot your ESAPI script data.

JavaScript's journey with ECMA: ES 2017

RRB NTPC Complete Math Revision Chapterwise All concepts Practice questions Hindi and English

How to Make Your Web Page Dance with jQuery — Part One

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
Hassan Ali

Hassan Ali

A Web-developer with a vision to help other people of the world and advise them how they can become a better web developer.

More from Medium

How do JavaScript arrow functions work and when should you use them?

call, apply and bind in JavaScript

7 Javascript operators you need to learn about!

What is THIS? Understanding the execution context in JavaScript