Javascript The Hard Parts
https://frontendmasters.com/courses/javascript-hard-parts/
#
Day 1#
5 Capacities we look for in candidates- Analytical problem solving with code
- Technical communication (can I implement your approach just from your explanation)
- Engineering best practices and approach (Debugging, code structure, patience, and referrence to docs)
- Non-technical communication (empathetic and thoughtful communication)
- Language and computer science experience
The first two points are the most important and these are what make or break a person applying to a job!
- JS is using Just in Time (JIT) compilation
#
Principles of JSGlobal Memory | |
---|---|
num | 3 |
multiplyBy2 | [f] |
output | 8 |
newOutput | 20 |
#
Global Execution ContextAs soon as we start running our code we create a Global Execution Context
- Global Memory
- Live memory of variables with data, Global Variable environment (Memory for storing variables)
A function can be invoked by adding parens to the end, defining a function is not the same as executing it. Executing a function creates a new execution context called Local Execution Context.
#
Local Execution ContextBasically, the value of output
would be undefined until the multiplyBy2
function finishes executing and closes the local execution context
#
CallstackCallstack is a stack, a stack is a data structure in which FILO, first in last out, all the execution contexts are handled in the callstack
Callstack |
---|
local() |
global() |
In this case, when local finishes it'll be pushed out the callstack and the control will go to the global() context, callstack keeps track of all the execution contexts.
#
Functional Programming- Pure Functions (no side effects) -- Its only consequence is the return value
- 'High Order functions' - highly valuable tool
#
Pair ProgrammingAnswer these:
โ I know what a variable is
A referrence to a memory area storing the related data
โ I've created a function before
Yes
โ I've added a CSS style before
Yes
โ I have implemented a sort algorithm (bubble, merge etc)
Yes - Bubble, Merge, Selection, Quick Sort
โ I can add a method to an objectโs prototype
Using object.prototype.method = function() {}
โ I understand the event loop in JavaScript
โ I understand 'callback functions' Callback functions are called when the given task is done, they introduce synchronous actions in an async js world โ I've built a project in React or Angular Yes โ I can handle collisions in hash tables No Ideos
Do these challenges: http://csbin.io/callbacks