Every language comes with it’s unique set of features.

Javascript has the following -

1. Interpreted

JavaScript is an interpreted language, meaning it's executed line-by-line at runtime by the JavaScript engine in the browser or server environment, rather than being compiled into machine code beforehand.

Upsides -

  1. There is one less step to do before running your code

Downsides -

  1. Performance Overhead:
  2. More prone to runtime errors

2. Dynamically Typed

Variables in JavaScript are not bound to a specific data type. Types are determined at runtime and can change as the program executes

C++ Code (won’t compile)

#include <iostream>

int main() {
  int a = 1;
  a = "hello";
  a = true;
}

JS Code (will compile)

var a = 1;
a = "harkirat";
a = true;

console.log(a)

3. Single threaded

JavaScript executes code in a single-threaded environment, meaning it processes one task at a time. We will dive deeper into this next week.