Q & A
- How does functional programming differ from object-oriented programming?
While both functional programming and OOP aim to provide bug-free and nicely coded structures, they approach the problem differently. With functional programming, you use functions as first-class citizens and apply function composition to deliver programs. With OOP, you use classes and objects to create abstractions and leverage design patterns to manage their communication type or structure.
- Is calling a function that checks the browser's local storage safe to use in functional programming and why?
No. Unless the function is capturing this operation in an IO effect, it can break purity. This also means that referential transparency is also affected, making it hard to figure out sources of problems, especially when your whole application is composed of functions.
- Are Higher-Order Functions (HOFs) part of functional programming concepts?
Yes. HOFs are functions that take a function as...