Section 1

Preview this deck

Class Inheritance

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (14)

Section 1

(14 cards)

Class Inheritance

Front

Instances inherit from classes in a hierarchical relationship to create sub-classes

Back

JS Programming Paradigms

Front

Event-driven Functional Imperative Object-oriented (prototype-based) Prototypal Inheritance

Back

Closure Uses

Front

Object data privacy Event handlers and callback functions Partial applications and currying Other functional programming patterns

Back

No side effects

Front

Shared state is not changed, causing fewer conflicts and bugs between different parts of the program

Back

Examples of side effects

Front

Mutation - modifying the argument that is passed to a function Shared state - when the function depends on an external value Asynchronous code

Back

JavaScript features that enable Functional Programming

Front

First-class functions (functions are treated like any other variable) Higher-order functions (functions that operate on other functions, by taking them as params or returning them) Closures Simple lambda syntax Easy to assign, pass, and return functions

Back

Examples of Functional Programming in JavaScript

Front

JavaScript array functions (map, filter, reduce)

Back

Idempotence

Front

A pure function will always return the same output for the same inputs

Back

Closure

Front

An inner function has access to the context in which it was created

Back

Functional Programming Benefits

Front

Reduces boilerplate, repetition, and syntax noise Most useful for 1-to-1 data mapping

Back

Functional programming languages

Front

Lisp, Haskell, Erlang, Curry, Clojure

Back

Functional Programming

Front

A programming paradigm that uses functions to create programs.

Back

OLOO

Front

Objects Linking to Other Objects

Back

Prototypal Inheritance

Front

JavaScript objects have a link to a prototype object. When trying to access a property of an object, the property will not only be sought on the object but on the prototype of the object, the prototype of the prototype, and so on until either a property with a matching name is found or the end of the prototype chain is reached.

Back