0% found this document useful (0 votes)
6 views2 pages

Difference Between let, var, const in JS

The document outlines foundational concepts of JavaScript and programming languages, including the differences between compiled and interpreted languages, with examples like C++ and Java for compiled, and JavaScript and Python for interpreted. It explains static versus dynamic typing, the single-threaded nature of JavaScript, and introduces basic programming constructs such as variables, data types, loops, arrays, objects, and functions. Additionally, it emphasizes the importance of saving files in VS Code before execution and mentions the use of JavaScript in web development.

Uploaded by

Bhavya
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Difference Between let, var, const in JS

The document outlines foundational concepts of JavaScript and programming languages, including the differences between compiled and interpreted languages, with examples like C++ and Java for compiled, and JavaScript and Python for interpreted. It explains static versus dynamic typing, the single-threaded nature of JavaScript, and introduces basic programming constructs such as variables, data types, loops, arrays, objects, and functions. Additionally, it emphasizes the importance of saving files in VS Code before execution and mentions the use of JavaScript in web development.

Uploaded by

Bhavya
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Jargons?

Week 1.2
Javascript foundation

Why languages?
how does computer work- applications, photo video etc in short storage purpose- ssd
zoom call surfing internet- ram- currently running things. Ram reads and understands only 0s and 1s
not any source code. Fro souce code to 0s and 1s is converted by compilers. C++ Jaca python etc are
high level languages that we underatsnad then it is converted to 0s and 1s by compilers that the
machine can understand.
languages are used to write applications.

Compiler?
High level codes- 0s and 1s
C++ most famous compiler- g++ temp is a binary file, gta file?
you can share the temp file so other people can run your code.

Javascript is a interpreted language


[Link](“Hello world”)
(syntax to take input in javascript?)
it runs the code line by line, compiles the code

Compiled languages- first need to compile then need to run, usually don’t compile if there is and
error in the code, example: c++, java, rust, golang

Interpreted languages- usually go line by line, can run partially if the error comes later, Example-
Javascript, Python.

Note : Save files on vs code before running!

For 99.9% of websites, javascript is the primary language. Browsers can understand HTML/CSS/JS
mostly.

Static vs dynamic language:

Javascript can be used for backend using [Link]. It as a dynamic language (datatypes can be
changed midcode).
C++ is static (If datatypes are changed mid code the compile will throw error). (explain dynamic and
static language?)

Typescript- to make js more static

Single threaded language:


Number of corres mean 1 process can be running on 1 core and another on other cores. Java script
acquires 1 core of a machine at a time. It can’t distribute the load. This why it is considered to be bad
language for scalable systems. There is a way to make it use all cores of your machine somehow
(later). So single threaded means that the labguage uses 1 core of machine at a time

Simple primitives:
Variables (let, var, const)- let can change its value, const only for constant
data types(strings numbers booleans)
if/else
loops/ for loops

Arrays
objects- can be nested (Write syntax for both arrays and objects and array for objects)

Functions:

1. Abstract out logic in your program.


2. Take arguments as an input
3. Return a value as an output
4. You can think of them as an independent program that is supposed to do something given an
input.
5. Function can take other functions as input (callbacks)

Global function that js provides- setTimeout(function, duration)

You might also like