Declarative programming vs Imperative programming
Declarative programming is a programming paradigm … that expresses the logic of a computation without describing its control flow.
Imperative programming is a programming paradigm that uses statements that change a program’s state.
Declarative Programming is like asking your friend to fix your car. You don’t care how to fix it, that’s up to her.
Imperative Programming is like your friend calling your father that tells her how to fix your car step by step.
Imperative code instructs JavaScript on how it should perform each step. With declarative code, we tell JavaScript what we want to be done, and let JavaScript take care of performing the steps.