JavaScript setup in Hindi | Beginner to Expert π₯ | Complete Course #4
Introduction and Setting up the Environment
The speaker introduces themselves and discusses the process of setting up the development environment.
Downloading Visual Studio Code
- To begin, download Visual Studio Code by visiting the official website.
- Choose the appropriate version for your operating system (Windows, Mac, or Linux).
- Select the stable version for a reliable experience.
Getting Started with Visual Studio Code
- After installing Visual Studio Code, open it to start coding.
- You can create a new file or open an existing project folder.
- Explore various options and features available in Visual Studio Code.
Running JavaScript Code
The speaker explains how to run JavaScript code using different tools.
Running JavaScript in Browsers
- One way to run JavaScript code is through web browsers like Chrome or Firefox.
- These browsers have built-in JavaScript engines that execute your code.
- Chrome uses V8 engine, while Firefox uses SpiderMonkey engine.
- Safari and Microsoft Edge also have their own JavaScript engines.
Downloading Chrome Browser
- If you don't have Chrome browser installed, you can download it from its official website.
- Visit your preferred browser's website and search for "download Chrome browser."
- Follow the instructions to install and open Chrome.
Running JavaScript in Browsers (continued)
- Once you have Chrome installed, you can write your JavaScript code directly in its developer console.
- The browser's JavaScript engine will execute your code and display any output or errors.
Introduction to Text Editors
The speaker introduces text editors as another tool for running JavaScript code.
Using Text Editors for Running JavaScript
- Text editors are another option for running JavaScript code.
- Visual Studio Code is a popular text editor that provides a convenient environment for coding.
- It offers features like syntax highlighting, code suggestions, and debugging tools.
Opening Projects in Visual Studio Code
- In Visual Studio Code, you can open existing project folders or create new files.
- The editor displays the file structure of your project and allows easy navigation.
Running JavaScript in Browsers (continued)
The speaker explains how JavaScript code runs within browsers due to the presence of built-in JavaScript engines.
Built-in JavaScript Engines in Browsers
- Each web browser has its own built-in JavaScript engine.
- Chrome uses V8 engine, Firefox uses SpiderMonkey engine, Safari has its own engine, and Microsoft Edge also has one.
Execution of JavaScript Code in Browsers
- When you write JavaScript code in a browser's developer console or within an HTML file, the respective browser's JavaScript engine executes it.
- This execution is possible because of the presence of the built-in JavaScript engines.
Introduction to Open Source Engines
The speaker discusses open-source JavaScript engines and their significance.
Open Source Nature of Some Engines
- Some JavaScript engines used by browsers are open source.
- For example, V8 engine used by Chrome is open source.
Noorjehan Project
- The Noorjehan project was created in 2009 with the aim of developing an open-source browser with a built-in V8 engine.
Node Process
In this section, the speaker discusses the process of using Node.
Understanding Node Process
- Node is a runtime environment for executing JavaScript code outside of a browser.
- It allows us to run JavaScript on the server-side and perform various tasks.
- To use Node, we need to install it and set up our development environment.
File Handling in Node
This section covers file handling in Node.
Reading and Writing Files
- We can read the contents of a file using the
fsmodule in Node.
- To read a file, we use the
fs.readFile()function and provide the file path as an argument.
- Similarly, we can write data to a file using the
fs.writeFile()function.
- When writing to a file, we need to specify the file path and the data to be written.
Running JavaScript Code
This section explains how to run JavaScript code in different environments.
Running JavaScript Code
- In a browser, we can run JavaScript code by opening the console or using
console.log()to display output.
- If we are using Node, we can run JavaScript code in the terminal or command prompt.
- In both cases, running JavaScript allows us to execute our code and see results.
Organizing Code in Projects
This section discusses organizing code in projects.
Organizing Code
- For larger projects with multiple files, it is important to organize our code properly.
- We can separate different functionalities into separate files for better maintainability.
- By linking these files together through imports or script tags, we can ensure that our code is structured and easy to manage.
Live Server and Code Changes
This section covers using a live server and handling code changes.
Using a Live Server
- A live server allows us to see the changes in our code immediately without manually refreshing the page.
- By installing a live server extension, we can run our code and see the updates in real-time.
- This eliminates the need for manual refreshes and improves development efficiency.
These are the key points from the transcript.
Introduction to Options
In this section, the speaker introduces various options related to a topic.
Understanding the Options
- The speaker discusses different options available.
- No further details are provided in the transcript.
JavaScript and its Applications
This section focuses on JavaScript and its applications.
Exploring JavaScript
- The speaker mentions "jaavaskript jaaaash" but it is unclear what it refers to.
- No further details are provided in the transcript.
Mention of "d pilgraya"
This section briefly mentions something related to "d pilgraya".
Brief Mention
- The phrase "d pilgraya" is mentioned, but no context or explanation is given.
Running JavaScript in Browser using Node.js
This section explains how to run JavaScript code in a browser using Node.js.
Steps for Running JavaScript in Browser with Node.js
- Open the website of Node.js.
- Right-click on the home page and select "Inspect".
- If "Inspect" is not visible, go to "Options" > "More Tools" > "Developer Tools".
- In the developer tools interface, navigate to the "Console", "Sources", and "Network" tabs.
- The console tab allows running JavaScript code.
- An example of running an alert function with a message is shown.
- Clearing the console can be done by pressing Ctrl+C (or Cmd+C on Mac).
- More complex expressions can be tested and debugged using the console.
Writing and Running JavaScript Files
This section explains how to write and run JavaScript files.
Writing and Running JavaScript Files
- Open a text editor and create a folder named "JavaScript".
- Open the folder in the text editor.
- Create a file named "app.js" with the .js extension.
- Connect the JavaScript file to an HTML file (e.g., index.html) using script tags.
- Write JavaScript code in the app.js file, such as console.log statements.
- Save the files and open the HTML file in a browser to see the output in the console.
Using Live Server for Automatic Refresh
This section explains how to use Live Server for automatic refresh when making changes to JavaScript files.
Using Live Server for Automatic Refresh
- Install Live Server if not already installed.
- Right-click on an HTML file and select "Open with Live Server" to automatically refresh changes made to JavaScript files within that project folder.
The remaining part of this transcript is not clear enough to provide meaningful summaries.