JavaScript: The dynamic language of the web.
JavaScript is a programming language that brings web pages to life. It's the core technology of the web, working alongside HTML and CSS. While HTML structures the content and CSS styles it. JavaScript adds interactivity and dynamic behaviour.
buttons, menus, sliders, etc.1995Brenden Eich, a programmer at Netscape Communication, created JavaScript in a mere 10 days. Initially named Mocha, it was later renamed LiveScript and finally JavaScript to capitalize on the popularity of Java at the time.
PurposeDesigned to add interactivity to static HTML pages, JavaScript brought life to the web.
1996 - 1997JavaScript gained rapid adoption with Netscape Navigator and Internet Explorer becoming the dominant browsers.
Browser warsIntense competiton between Netscape and Microsoft led to different JavaScript implementations, causing compatiblity issues.
ECMAScriptTo standardize the language, ECMA International created ECMAScript, a specification for JavaScript.
1997 - 2000The Document Object Model ( DOM ) and Dynamic HTML ( DHTML ) emerged, expanding JavaScript capablities.
2006 - 2010jquery and other libraries simplified JavaScript development and popularized its use.
2009 - 2015ECMAScript 5 and 6 introduced significant improvements, making JavaScript a more robust language.
2015 onwardsJavaScript has evolved rapidly, becoming a full-fledge language for building complex applications.
Node.jsRevolutionized server-side development with JavaScript, enabling full stack development.
Frameworks and LibrariesReact, Angular, Vue, and others emerged, providing powerful tools for building user interfaces.
While JavaScript initially designed for the client-side, its versatility and popularity led to its expansion into server-side development.
Before Node.jsSeveral attempts were made to run JavaScript on the server, but they lacked widespread adoption.
ChallengesPerformance, scalablity, and ecosystem limitations hindered these early efforts.
2009Ryan Dahl released Node.js, a JavaScript runtime built on chrome's V8 Javascript engine.
Event-driven architectureNode.js's non-blocking, event-driven approach made it highly efficient for handling concurrent connections.
Package ecosystem ( npm )A vast collection of reusable modules accelerated development.
Full-Stack JavaScriptDevelopers could now use JavaScript for both front-end and back-end development.
Rapid growthNode.js gained immense popularity, becoming a preferred choice for server-side development
Diverse applicationUsed for web servers, real-time applications, APIs, and more.
Ecosystem expansionA thriving ecosystem of frameworks, libraries, and tools emerged.
Other optionsWhile Node.js dominates the server-side JavaScript landscape, alternatives like Deno have emerged.
Continued evolutionJavaScript and Node.js are constantly evolving, with new features and improvements enhancing their capablities.
Lets create a file as test.js
console.log("vikash");
Inside the test.js file we have console.log("vikash") and each word has specific task or meaning on the programming.
console does a specific task when the source code executed on the software.
Lets create another file as test.txt
console.log("vikash")
But the main thing, which file can be executed, when we inject them into a software ( compiler/interpreter ).
This software has a task to identify the extension of file and perform actions according to the written source code.
Every programming language has a syntax to write their source code and every programming language comes with their extension.
eg. .js, .java, .cpp, .py and so on..
In early days, People runs script using a HTML file.
They just simply create an index.html file and inside it they start a <script> tag for writing Javascript.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<script>
console.log("Hello world!");
</script>
</body>
</html>
and executes the HTML file on the browser. Because JavaScript is hidden inside for a long time in the browser.
But in the recent past It emerged from the browser by Ryan Dahl.
Nowadays, we can execute our JavaScript code standalone like python, java, c++ code.
For running JavaScript, There is no any higher requirement. We can run our code directly on the browser.
Directly on browser's console
Install a runtime for JavaScript like node.js
Once you download and installing, confirm it.
node -v
Install a code editor ( IDE ) like vs code
VS code is an IDE ( Integrated Development Environment ) provides multiple features like auto indentation, code suggestion, Extension supports, File tracking using git and GitHub, Integrated Terminal.
Create a directory where you want to store your JavaScript file, open it in vs code.
Lets create a file as test.js and write some code
// test.js
console.log("hello world!");
Now look on the top of the vs code you will find Terminal, create a new terminal and execute the source file
node test.js