Author: Joanna, adding date: 2019-10-04

What are two main JavaScript programming paradigms?

Author: Joanna, adding date: 2019-10-05


Object-oriented programming (OOP - "object-oriented programming"). From an OOP perspective, an application is a collection of "objects" that communicate with each other. Objects contain data and perform some logic based on their data. We use classes to create objects in OOP. Functional programming - based on functions. It revolves around the idea that the program consists of a set of functions that follow certain rules. The main concept of functional programming is the idea of pure functions. These are functions that take some input data, operate on it and return the output data without modifying any variables our state outside of the scope of the function. Any function that reaches for the DOM or uses variables that are not within its scope is considered unclean and does not step up to the standards of functional programming.

Please log in to add answer