The most common explanation of the difference between imperative and declarative programming is that imperative code tells the computer how to do things and declarative program focuses on what you want from the computer. You may feel like this explanation is quite confusing but I will make sure to make it much more clear.
Article with code examples: https://medium.com/weekly-webtips/imperative-vs-declarative-programming-in-javascript-25511b90cdb7
00:00 - Intro Imperative vs Declarative
01:24 - Statements versus Expressions
04:30 - State management
06:50 - Functional Programming in JavaScript
09:25 - Procedural vs Functional Programming
10:56 - Object-Oriented vs Functional Programming
12:16 - Imperative versus declarative cycles and arrays
15:31 - Conclusion