I'll show you how to get started with JavaScript on your computer in this tutorial.
Four Quick Thoughts on JavaScript.
What is JavaScript, and how does it work?
JavaScript, sometimes known as JS, is a programming language that, together with HTML and CSS, is one of the essential technologies of the World Wide Web.
JavaScript is a widely used programming language with several uses.
What are you going to do with JavaScript?
Previously, JavaScript was mostly used to interact with webpages, such as verifying forms and creating animations. For server-side programming, mobile app development, and game development, we now employ JavaScript.
What is the location where JavaScript code is executed?
JavaScript is a scripting language that runs on web pages in the browser and can also be run on the server.
There are some differences between JavaScript and ECMAScript.
ECMAScript is a programming language standard for scripting languages like JavaScript. EMACScript is a trademarked language specification for scripting.
JavaScript, on the other hand, is an ECMAScript-based language. ECMAScript is a standard for scripting languages like JavaScript.
Let's make a webpage that uses JavaScript to interact.
The first step is to download and install vscode, as well as the following extension. Step 1: Download vscode from here. Step 2: Go to the market place and search for "live server" in the search box. Step 3: Select Install. Step 4: You're finished.
Now, follow the steps below to run JavaScript from a webpage.
Step 1. Launch VS Code. Step 2. Select File. Step 3. Create a new file. Step 4. Save it as index.html
Copy and paste the HTML code below into the index.html file you just made.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Getting started with JS</title>
</head>
<body>
</body>
</html>
Now we'll make an app.js file in JavaScript.
Copy the following JavaScript code and save it in the app.js file you generated, just like we did before.
console.log('hello world');
Now we'll link the app.js and index.html files so they can read each other's code.
As a result, we may accomplish this by inserting the following code into index.html.
In our HTML, we will insert the following between the opening and closing tags in the body element.
<script scr="app.js"></script>
Right-click the index.html file and choose "open with live server" from the menu.
Check to see if our JavaScript code worked.
To begin, right-click on the website. Second, select Inspect. Finally, select the console tab.
Hurray!! You have earned the title of programmer.