DEV Community

AbdUl.Dev
AbdUl.Dev

Posted on

Multi paradigms in one language (JavaScritp)

**JavaScript **supports multiple programming paradigms, making it a powerful and flexible language. The main paradigms in JavaScript include:

1.

Imperative Programming :

Tells the computer what to do step by step. this Paradigma make you think like First do this, then that..

2

Declarative Programming :

Tells the computer what you want, not how to do it , Like saying "I want a cake" without telling how to make it — the system figures it out.

3

Object-Oriented Programming (OOP) :

Code is organized into objects and classes(like real-world things) Some Behaviours Like Inheritance and Polymrphism , Abstraction , Encapsulation.

4

Functional Programming (FP) :

Use functions to do everything , Like using a machine where input goes in, output comes out, and nothing else changes ---- ** It doesn’t touch or change any outside data — just takes a value and returns a new one.**

5

Event-Driven Programming :

Code reacts to events (click, scroll, input).

Like a doorbell — nothing happens until someone presses it.

6

Reactive Programming with libraries like RxJS :

Works with changing values over time (like a stream of water) . Imagine a temperature sensor — you listen to updates and react as they come. We Use in it Patterns Like Observable (Programming with asynchronous data streams)

Top comments (0)