Classes, Inheritance, Functional Programming - andrewkyllo-401-advanced-javascript/seattle-javascript-401d34 GitHub Wiki

Functional Programming

  • Programming with a distinction between pure code and impure code.
  • Pure code has no side effects and gets the same results every time you run it.

Pure functions

  • Return a value solely based on what was passed into it.
  • Does not mutate data, produces no side effects, and can easily be reused.

Higher order functions

  • A function that operates on other functions.

Objects and Inheritance

  • JavaScript objects use prototype-based inheritance

Errors

  • Important for debugging broken code.

Writing Good Error Messages

  • Will have a timestamp, message about problem, message about cause, consistent format, and a severity level.

Handling Thrown Errors

  • Forces developers to use a function correctly.
  • Unhandled errors will often crash javascript and stop program execution.
  • try {} catch (error) {} all servers to run with errors