One Pager Cheat Sheet
- JavaScript allows for the implementation of
functional programming
, combining object-oriented, functional and procedural programming paradigms. - Functional programming is a programming paradigm which uses a
declarative
rather than animperative
style, allowing for concise instruction and improved readability. - The three main programming paradigms are Object-oriented, Procedural and Functional, each of which have different approaches to programming computers, such as data representation with
classes
andobjects
for Object-oriented programming anddeclarative
programming for Functional programming. A
pure functionis a type of function which always returns the same output when given the same input, regardless of the number of times it has been called.
- False,
referential transparency
applies to pure functions, which can be easily tested, reused and have no side effects. - Referential Transparency is the ability to replace a function with its return value without changing its meaning.
- No functions with
side effects
are consideredpure
; therefore this is an impure function. - Higher-order functions
promote reusability
and allow us toisolate actions
and performfunction composition
, among other uses, such as the example offilter()
shown in the article. - Be
curious
andpractice
- it's easy tounderstand
,grow
andmaintain
Functional Programs -Happy Coding!
- The
length()
function is the odd one out, as it is not related to functional programming like the other terms.