This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VIDEO REMAINING INTERNAL HELPER METHODS | |
// QUESTIONS AND OBSERVATIONS | |
//QUESTION 1: why object[key] == null and not object[key] === undefined ? Why its compare it with null instead of undefined. Because if an object property is missing obj['prop'] it will return undefined not null. | |
// QUESTION 2: object[key] = defs[key]; if defaultObject has an array as property with couple of values instead of primitive values then it will copy to the new return object that array by reference and if you change a value to one it will change to all. | |
var defaultCar = { | |
color: ['grey', 'red'], | |
wheels: 4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var libs = {}; | |
function librarySystem(libName, depArr, cb){ | |
if (arguments.length > 1 && depArr.length >= 1){ | |
var storArr = []; | |
for(var i = 0; i < depArr.length; i++){ | |
storArr.push(libs[depArr[i]]); | |
} | |
libs[libName] = cb.apply(this, storArr); | |
} else { | |
libs[libName] = cb(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (function() { | |
// var libraryStorage = {}; | |
// function librarySystem(libraryName, callback) { | |
// if (arguments.length > 1) { | |
// libraryStorage[libraryName] = callback(); | |
// } else { | |
// return libraryStorage[libraryName]; | |
// } | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en" ng-app="app"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Wait and Eat</title> | |
<!--Bootstrap latest compiled and minified CSS--> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
<!--Optional theme--> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function runWithDebugger(callback){ | |
debugger; | |
callback.apply(null, arguments[1]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Read the answer and try to figure out what it does. Write it out on paper. Add notes, annotate it. | |
2. Run the code, see how it works, what arguments it takes, edge cases, etc. | |
3. Run it through the debugger, Use different arguments to test different scenarios. | |
4. Try replicating the function by writing out single statements in the console. | |
5. Be able to write the entire function on your own without looking at the solution. Could include mock interviews. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function returnFive() { | |
var number = 5; | |
return number; | |
} | |
function returnNothing() { | |
var number = 5; | |
} | |
var five = returnFive(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function outer(usedInsideInner) { | |
return function() { | |
console.log(usedInsideInner); | |
} | |
} | |
var inner = outer(5); | |
inner(); // should log 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To join the video chat, click the big "Call in" button (limited to 4 people). | |
Ask questions in the live chat on the right. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
angular | |
.module('app', []); | |
.run(function() { | |
console.log('did this file run?'); | |
}) | |
})(); |