• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/10

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

10 Cards in this Set

  • Front
  • Back

Pure functions (3 main aspects)

1. Given the same input, will always return the same output.(Referential transparency)


2. Produces no side effects.


3. Relies on no external state.

Array.slice() vs Array.splice()

Splice : changes the original array. Arguments : (index - position atbwhich to add/remove items, nr of items to be removed, ...items to be added)


Slice : doesnt change the original array. Returns selected elements in an array as a new array object. Arguments : (Start of selection, end of selection)

Regular expressions

General info

Symbols

Symbols - kind of enumerable type. Can be used as an identifier. Can not be changed (are immutable)


Ex.:


let capital = Symbol("state capital");



let Pennsylvania = {};


Pennsylvania[capital] = "Harrisburg";



Ex.: Let employNum = Symbol.for("employee number");



eval vs void

Eval parses given String and evaluates the code.


Void evaluates the code and always returns undefined

What does (3, 4) return

It returns 4. In this case "," is an operator which returns the last expression from left to right

Floor vs ceiling vs truncate vs round

Math.Floor, which rounds down towards negative infinity.Math.Ceiling, which rounds up towards positive infinity.Math.Truncate, which rounds up or down towards zero.Math.Round, which rounds to the nearest integer or specified number of decimal places. You can specify the behavior if it's exactly equidistant between two possibilities, such as rounding so that the final digit is even ("Round(2.5,MidpointRounding.ToEven)" becoming 2) or so that it's further away from zero ("Round(2.5,MidpointRounding.AwayFromZero)" becoming 3).

Substr vs substring

Substr - takes as parameters (from, length)


Substring - takes as parameters (from, to) - not including character with last index


Both start their index at 0.

Object.seal vs Object.freeze

Seal - prevents adding/removing prop; using delete will return false; makes every prop non configurable


Freeze - what seal does + prevents changing any existing prop

SOLID

1) Single responsibility principle


2) Open/closed principle


3) Liskov substitution principle (derived class should be possible to substitute with the base class)


4) Interface segregation principle (a client shouldnt depend on interfaces he doesnt use)


5) Dependency inversion principle (high level modules should not depend on low level modules, both should depend on abstractions; abstractions should not depend on details)