Declarative vs Imperative Coding Paradigm

Declarative is the what without the logic for the how. eg HTML, JSON

Imperative is the logic flow, eg: Java, Python, any oops or functional programming language

via: https://medium.com/front-end-weekly/imperative-versus-declarative-code-whats-the-difference-adc7dd6c8380

Imperatively speaking

Imperative paradigm

class Number {  constructor (number = 0) {
this.number = number;
  
add (x) {
this.number = this.number + x;}const myNumber = new Number (5);
myNumber.add (3);
console.log (myNumber.number); // 8

Declarative paradigm

const sum = a => b => a + b;
console.log (sum (5) (3)); // 8

Final thought

Comments