Sunday, April 2, 2023

Learning JavaScript as a Second Language (Lesson 1)

JavaScript’s First Lesson

Questions

  • Are you familiar with Programming?
  • Which programming languages do you know?
  • As in: Java, C, C++, Python (or maybe JavaScript itself)
  • How much would you rate yourself in JavaScript out of 10?
  • How much would you rate yourself in Python out of 10?

  • Have you any of experience of coding in JavaScript?
  • VSCode is not an environment. It is an editor.
  • What was the environment you were coding in?
  • Like: Console, or Browser, Node.js

What is a Developer Console (or DevTools) in Browser?

A developer console (also known as DevTools or Developer Tools) in a browser is a built-in set of debugging and analysis tools that enable developers to inspect and debug web pages or web applications. It provides various features for developers to examine the structure and behavior of web pages, including:

Inspecting HTML and CSS: Developers can view the HTML and CSS code of a web page and make changes to them in real-time to see how they affect the appearance of the page.

Debugging JavaScript: Developers can set breakpoints in their JavaScript code and step through it to find and fix bugs.

Monitoring network activity: Developers can monitor network requests and responses to identify performance issues or errors.

Analyzing performance: Developers can measure the performance of a web page, including load times, resource usage, and memory consumption.

The developer console is a powerful tool that can help developers troubleshoot issues and optimize the performance of their web applications. It is built into most modern web browsers and can be accessed by pressing F12 or by right-clicking on a web page and selecting "Inspect" from the context menu.

Developer Tools in Chrome

Developer Tools in Firefox

Where to run the JavaScript code?

  • Where to run the JavaScript code?
  • In console
  • In browser
  • In Node.js environment

In Console

In Browser


In Node.js

  • Installing Node.js on Ubuntu
  • $ sudo apt install nodejs
  • $ sudo apt install npm

Data Types

  • What all data types are you aware of?
  • 1. String
  • 2. Number (in JavaScript all Integer, Float and Double fall under the type "number")
  • 3. Boolean
  • 4. Array (also called List in Python)
Homework for both Python and JavaScript
1. Declare a variable with the above mentioned data types.
2. Also process that variable in some way. (Or we can say: show some operation on it)

String

  • String Concatenation

Differences between var, let and const

Tags: Technology,JavaScript,

No comments:

Post a Comment