DEV Community

subash
subash

Posted on

WHAT IS JAVASCRIPT

JavaScript is an essential language for web development. It transforms static web pages into dynamic and interactive experiences. With its simplicity and powerful features, it remains one of the most widely used programming languages today.

1.JavaScript is the high level Programming Language for the Web.
2.Used to make webpages dynamic
3.It is a scripting language
4.It is Single threaded
5.It follows OOPs concept (Object-Oriented Programming)

High-Level Programming Language

JavaScript is a high-level language, in order to easy to read and write.Developers don’t need to worry about low-level details like memory management.
Low-level details = the basic internal operations of a computer (like memory, CPU, and binary processing).

JavaScript is used to make web pages dynamic.

It allows you to:
Update content without reloading the page
Handle user inputs
Create animations and effects

Example: Form validation, dropdown menus, live updates

Scripting Language

JavaScript is a scripting language, meaning it is executed directly in the browser without needing compilation. It automates tasks and enhances user experience.
JavaScript uses both an interpreter and a JIT compiler together.

Step 1: The interpreter starts executing the code quickly.
Step 2: The JIT compiler observes which parts of the code are executed frequently.
Step 3: Those parts are compiled into machine code.
Step 4: The program runs faster after optimization.

This combination provides both quick startup and high performance.

JavaScript is neither purely interpreted nor purely compiled.

It uses an interpreter to start execution quickly and a JIT compiler to optimize performance during runtime.

JIT = Just-In-Time Compiler

Single-Threaded

JavaScript can do only ONE task at a time.
But uses event loop to manage multiple tasks

Event loop only manages tasks
It does NOT run multiple tasks at the same time

Supports Object-Oriented Programming (OOP)

JavaScript follows object-oriented programming concepts. It allows developers to organize code using:

Objects
Classes--(TBD)
Inheritance--(TBD)

This helps in writing clean and reusable code.

What are DataTypes?

Two types
Primitive and Non-Primitive

Primitive DataTypes

1.String
2.Number
3.Boolean
4.BigInt
5.Symbol
6.Null
7.Undefined
Enter fullscreen mode Exit fullscreen mode

Non-Primitive

1.Object
2.Array
3.Functions
4.Date(TBD)
5.RegExp(TBD)
Enter fullscreen mode Exit fullscreen mode

#What is Stack?

FILO = First In Last Out

A simple memory area
Stores:
Primitive values (number, string, boolean)
Function calls
Stack = stores primitive values and function calls (fast, fixed)

What is Heap?

A large memory area
Stores:

Objects
Arrays
Functions (reference)

Heap = stores objects and complex data (flexible, slower)

REFERENCES

  1. https://dev.to/sivakumar_mathiyalagan_/basic-javascript-questionnaires-e6l

Top comments (0)