DEV Community

Santhosh Kumar
Santhosh Kumar

Posted on

2

AN INTRODUCTION TO JAVASCRIPT

This post was originally published on my blog, find original post here

Lets see what is Javascript, what we can achieve with it and
limitations of Javascript.

JavaScript

What is JavaScript ?

JavaScript is one of the most popular programming languages in the world.
Being the first and the only scripting language that was supported natively by web browsers, it simply stuck

Javascript makes web pages alive

Before Javascript, every website provides static content which does not make webpages appear alive.
Javascript allows to implement complex things like displaying time, validate the web form, interactive maps, 2D/3D graphics.

Javascript is a scripting language, so scripts are executed as plain text.
They don't need to be compiled to execute.They can be written in webpage and executed when web browser loads the web page.

Java ☕ nd Javascript are very different programming languages.

JavaScript was originally named Mocha, later it was renamed to LiveScript, and then to JavaScript. When Javascript was created, Java was very popular at that time, so they decided that renaming it as Javascript would help it.

JavaScript engine

V8

Javascript engine is virtual machine which executes Javascript in the browser.
Javascript can run on any device which has Javascript engine. Javascript converts the script to the machine language. Machine code runs pretty fast.

Each browser has its own Javascript engine

Javascript engine Browser
V8 Chrome and Opera
SpiderMonkey FireFox
ChakraCore MicroSoft Edge

SpiderMonkey is the first JavaScript engine, written by Brendan Eich (creator of the JavaScript)

Node.js is a JavaScript runtime environment built on Chrome's V8 JavaScript engine. Node.js executes JavaScript code in server-side.

What can JavaScript do ?

Javascript is well-suited for performing task in the browser. It is primarily used to interact with users.

  • It can change existing HTML content,modify HTML styles, HTML attributes.
  • It can validate input forms.
  • React to user actions like mouse clicks, key presses
  • Perform the calculation.
  • send requests to server, get the data (AJAX)
  • get and set cookies in the browser
  • store the data in browser local storage

Javascript's capabilities depends on the its environment. Nodejs allows Javascript to access file system, access network and call system call

Javascript has full integration with HTML/CSS, but Javascript on a webpage doesnot have access to files in the hard disk.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay