Top 3 Concepts to Learn Before Day One:
- Functional Composition
- Higher Order Functions
- Prototypal Inheritance
- DEFINITION: Combining simple functions to build more complicated ones
- Your code should be broken up into small functions, each of which does one thing well. Then, string these functions along. The output from one function becomes the input to another function
SUMMARY: Learning how to write functions which chain together is an approach which tends to make the code easier to reason about. This works best when functions are pure, i.e. they don’t rely on or use anything except their inputs.
Higher Order Functions
- DEFINITION: functions which take other functions as input, and/or return functions as output
- Example: suppose we have a simple function “add” which adds one to a number: n => n + 1. A higher order function could take in that simple function, and give us back an enhanced version. This new function behaves similarly to “add”, but also keeps track of how many times it is called.
SUMMARY: Higher order functions make for really interesting programming techniques, where functions can be transformed, enhanced, and used in abstract ways.
- Prototypal inheritance is similar to class-based inheritance from object-oriented languages
- Classes are a blueprint; you can spawn multiple instances with properties copied from that blueprint
- Prototypes are a source; you can spawn multiple instances that share properties on the prototype
- However, prototypal inheritance actually differs from class-based inheritance in an important way
- With classes, properties are copied down into the instances, but are then separate
- With prototypes, instances point back to their prototype; changing a prototype property changes all the child instances
SUMMARY: The differences between prototypal inheritance and classes are:
- classes: the instances are copies of the blueprint
- prototypal inheritance: new objects are just pointing back to a prototype object. Objects delegate to other objects.
Resources for learning these concepts:
- Fullstack Academy prep courses
- Free online materials
- YouTube Channel - Fun Fun Function
- Paid online materials
How to Pass a Technical Job Interview
Learn which questions you'll be asked, how to answer them, and how to prepare for the interview!
How Successful Are Bootcamp Grads?
What will your career look like post-bootcamp? Watch a video Q&A with Flatiron School's Careers VP
8 Steps to Keep Learning After Bootcamp
Learn what it takes to stay on top of your learning after you finish a coding bootcamp!