Learnjavascriptfrombeginnertomaster Sample
Learnjavascriptfrombeginnertomaster Sample
VigoWebs
This book is for sale at http://leanpub.com/learnjavascriptfrombeginnertomaster
This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing
process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and
many iterations to get reader feedback, pivot until you have the right book and build traction once
you do.
Chapter 3 - Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Operators in JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Chapter 3 - Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Chapter 6 - Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 6 - Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Chapter 7 - Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
CONTENTS
Array methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Multi-dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Chapter 7 - Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Chapter 8 - Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Creating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Chapter 8 - Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Chapter 9 - Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Defining Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Property descriptors and flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Seal an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Property getters and setters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Chapter 9 - Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Prototypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Chapter 13 - Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Chapter 15 - ES6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
ES6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Transpile and Polyfill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Block Scope Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Spread and Rest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Default parameter value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Destructuring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Object Literal Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Template Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Chapter 15 - Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
null is an object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Precision of 0.1 + 0.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Comparison of three numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Object as a key of object’s property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
try..catch finally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Multiple inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
A class of class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Tricky arrow functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Arrow functions cannot be a constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
arguments in arrow functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Tricky return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Math.max() less than Math.min() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Comparing null to 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Default behavior Array.prototype.sort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Array and Object addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Chapter 22 - Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Chapter 1 - Introduction to JavaScript
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
What Is JavaScript?
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Inline JavaScript
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 1 - Introduction to JavaScript 2
External JavaScript
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Script Loading
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 1 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 2 - Variables and Datatypes
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
What is Variable?
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Data Types
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Number
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
String
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Boolean
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Null
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 2 - Variables and Datatypes 4
Undefined
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Objects
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 2 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 3 - Operators
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Operators in JavaScript
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Assignment operators
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Comparison operators
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Arithmetic operators
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Bitwise operators
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 3 - Operators 6
Bitwise OR: |
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Bitwise X OR: ^
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Bitwise NOT: ∼
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Logical operators
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Logical OR: ||
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 3 - Operators 7
Logical NOT: !
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
String operators
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Comma operator
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Unary operators
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
typeof
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
delete
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
void
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 3 - Operators 8
Relational operators
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
in
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Grouping operator
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 3 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 4 - Control Flow
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Control Flow
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Block Statements
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Conditional statements
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
if-else statement
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
switch statement
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Exception Handling
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 4 - Control Flow 10
try … catch
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
finally block
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 4 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 5 - Loops and Iteration
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
for loop
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
while statement
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
do … while Statement
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
break statement
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
continue statement
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 5 - Loops and Iteration 12
for..in statement
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
for..of statement
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 5 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 6 - Functions
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Functions
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Function declarations
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Function expressions
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
arguments object
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 6 - Functions 14
Chapter 6 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 7 - Arrays
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Arrays
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Creating an array
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Populating array
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Array methods
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
concat
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 7 - Arrays 16
join
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
push
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
pop
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
shift
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
unshift
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
slice
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
splice
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
reverse
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 7 - Arrays 17
sort
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
indexOf
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
lastIndexOf
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
forEach
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
map
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
filter
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
every
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
some
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 7 - Arrays 18
reduce
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Multi-dimensional Arrays
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 7 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 8 - Objects
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Objects
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Overview
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Creating Objects
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Object initializers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Constructor function
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 8 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 8 - Objects 20
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 9 - Objects
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Objects
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Defining Methods
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Iteration
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
for…in loop
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Object.keys()
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Object.getOwnPropertyNames()
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 9 - Objects 22
Non-writable
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Non-enumerable
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Non-configurable
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Object.defineProperties
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Seal an Object
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Object.preventExtensions(obj)
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Object.seal(obj)
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 9 - Objects 23
Object.freeze(obj)
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Object.isExtensible(obj)
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Object.isSealed(obj)
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Object.isFrozen(obj)
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 9 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 10 - Intermediate JavaScript 1
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Strict mode
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Type conversion
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
parseInt()
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 10 - Intermediate JavaScript 1 25
parseFloat()
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Number()
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 10 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 11 - Intermediate JavaScript 2
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Boxed objects
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Hoisting
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Scope
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Lexical scope
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Closures
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 11 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 12 - Intermediate JavaScript 3
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Call stack
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
What is this?
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Default binding
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Implicit binding
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 12 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 13 - Prototypes and
Inheritance
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Prototypes
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Constructors
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Object.create()
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Performance
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 13 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 13 - Prototypes and Inheritance 31
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 14 - Object Oriented
JavaScript
Object Oriented JavaScript
Object oriented programming or OOP is a methodology to create our program using Objects and
Classes. The basic idea of OOP is that we use objects to model real world things that we want
to represent inside our programs, and provide a simple way to access functionality that would
otherwise be hard or impossible.
Objects can contain property, which represents information about the thing we are trying to model
and methods or actions that represents a behavior. For example, if we think a car as an object,
then the number of wheels, the type of car, the color of car becomes the properties of the car. And
starting or stopping the car becomes actions. Data in objects can be stored neatly without exposing
to the outer world (which is called encapsulation), can be given a specific name to refer to (which is
sometimes called a namespace).
Consider we are going to develop an application for an organization where there are developers
and managers. To handle the data of developers and managers we could create an object model like
below:
If you can observe the above code, it has duplicate properties in both model, name and id. We
can make this better by creating one parent objects and create two sub-objects for developer and
manager.
We have moved the common properties to the top of the prototype chain and let the child objects
to call them. This make our developer and manager constructors more manageable. If you inspect
more, we can see that the greeting action has almost similar in both. It is same in both except for
the role. So we can also move this method to the top.
16 this.role = 'Manager';
17 }
18 Manager.prototype = Object.create(Employee.prototype);
19 Manager.constructor = Manager;
This looks even better. We have, like moved the common properties to top, moved the common
methods to the top. We have also make our Developer and Manager inherits data and behavior from
the Employee, so we can reuse functionality common to all the object types rather than having to
duplicate it. Now let us check our models by creating instances of them.
The greeting method is same in both objects and implemented the same functionality. But their
result are different based on child objects. The ability of multiple object types to implement the
same functionality is called polymorphism.
If you have noticed, we have assigned the constructor property of Developer (or Manager) to the
same function again after the prototype. This is because, when we are overwriting the prototype,
it also overwrites the constructor property to Employee. So we have manually adjust it back to its
original value.
One of the other features in OOP is Encapsulation. Encapsulation is the ability of an object to be a
container (or capsule) for its member properties, including variables and methods. This object can
protect its data from outside world or restricting its access. Imaging our Developer object needs
to have a private data which is noOfWorkingDays. It should be accessed like name or id which are
common. Let us see how can we achieve this.
If you can remember, functions create scope. That means variables declared inside a function can
not be accessed from outside. So creating a local variable, we can encapsulate our data inside the
function.
If we want to expose this data to outside, we can create methods to write and read the data from
the object. This way we can be sure that there is no way to directly manipulate our private data
noOfWorkingDays. Any read or write operation should be done from our generated methods.
These private variables private to these objects which means other instance of the Developer object
will have its own numOfWorkingDays.
1 joseph.getWorkingDays(); // 1
2 var andrew = new Developer('Andrew', 3);
3 andrew.getWorkingDays(); // 0
4 andrew.updateWorkingDays();
5 andrew.getWorkingDays(); // 1
Because of the way JavaScript works, with the prototype chain, etc., the sharing of functionality
between objects is often called delegation. Specialized objects delegate functionality to a generic
object type.
In terms of using inheritance in your own code, you probably won’t use it often, especially to begin
with, and in small projects. It is a waste of time to use objects and inheritance just for the sake of it
when you don’t need them. But as your code bases get larger, you are more likely to find a need for
Chapter 14 - Object Oriented JavaScript 36
it. If you find yourself starting to create a number of objects that have similar features, then creating
a generic object type to contain all the shared functionality and inheriting those features in more
specialized object types can be convenient and useful.
When using inheritance, you are advised to not have too many levels of inheritance, and to keep
careful track of where you define your methods and properties. It is possible to start writing code that
temporarily modifies the prototypes of built-in browser objects, but you should not do this unless
you have a really good reason. Too much inheritance can lead to endless confusion, and endless pain
when you try to debug such code.
Finally, using functions with prototype looks like lot of work to link objects. But since ES6
introduction of class, extends and super, it becomes very easy to create classes and share
functionalities among them. We will explain all the ES6 features in the coming lessons.
Chapter 14 - Quiz
Oops! That was an incredible achievement. OOP or Object oriented programming is an important
concept not only in JavaScript but in most of the languages that every developer should know. Go
ahead and take this simple questions before you continue your journey.
1. Object oriented programming or OOP is a methodology to create our program using which of
these?
2. If you think of a car as an object, which of the below can be said to equal to starting the car?
a. method
b. property
c. data
3. Having a parent class to have common properties and methods leads to reducing code duplication.
a. True
b. False
4. The ability of multiple object types to implement the same functionality is called what?
a. Polymorphism
b. Encapsulation
Chapter 14 - Object Oriented JavaScript 37
c. OOP
5. The idea of OOP is to use objects to model real world things that we want to represent, and provide
a simple way to access functionality that would otherwise be hard or impossible.
a. True
b. False
6. A class sometimes can shield its member from outside world and restrict access to them. How is
this behavior called?
a. Polymorphism
b. Encapsulation
c. OOP
a. Developer.prototype = Object.create(Employee.prototype);
b. Employee.prototype = Object.create(Employee.prototype);
c. Employee.prototype = Object.create(Developer.prototype);
b. Using prototype
c. Using inheritance
a. No
b. Yes
10. It is advised to have too many levels of inheritance. State true of false.
a. True
b. False
11. With the prototype chain, etc., the sharing of functionality between objects is called … ?
a. sharing
b. delegation
c. polymorphism
Answers
1. a); Object oriented programming or OOP is a methodology to create our program using which
of Object and class.
2. a); Starting or stopping car denotes an action. And in objects methods are doing some actions
and properties are having some data.
3. a); True. When a parent class have common properties and methods, it leads to reducing code
duplication.
4. a); The ability of multiple object types to implement the same functionality is called Polymor-
phism.
5. a); True. The basic idea of OOP is that we use objects to model real world things that we want
to represent inside our programs, and provide a simple way to access functionality that would
otherwise be hard or impossible.
6. b); Encapsulation is the ability of an object to be a container (or capsule) for its member
properties, including variables and methods. This object can protect its data from outside world
or restricting its access.
7. a); To inherit properties from Employee object, we need to modify the prototype of Developer
to Developer.prototype = Object.create(Employee.prototype).
8. a); Functions create scope, that means variables declared inside a function cannot be accessed
from outside. So creating a local variable, we can encapsulate our data inside the function.
9. a); The private variables private to these objects which means other instance of the Developer
object will have its own numOfWorkingDays.
10. b); When using inheritance, you are advised to not have too many levels of inheritance since
it can lead to endless confusion, and pain.
11. b); The sharing of functionality between objects is often called delegation. Specialized objects
delegate functionality to a generic object type.
Chapter 15 - ES6
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
ES6
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Destructuring
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 15 - ES6 40
Template Literals
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Symbols
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 15 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 16 - ES6 Part 2
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
ES6 Continues
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Arrow functions
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
for..of loop
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Collections
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Maps
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
WeakMaps
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 16 - ES6 Part 2 42
Set
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
WeakSet
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Generators
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Modules
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
import
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 16 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 17 - Class and Promises
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Class
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
new.target
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Static properties
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Promises
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Promise.race
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Limitations
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 17 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 18 - Advance JavaScript
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Advance JavaScript
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Event Loop
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Async functions
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Proxies
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Reflect
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 18 - Advance JavaScript 46
Reflect.apply
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Reflect.construct()
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Reflect.get()
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Reflect.has()
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 18 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 19 - Working with DOM
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Find an Element by ID
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Changing CSS
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 19 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 20 - Event Listener and BOM
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
addEventListener
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
stopImmediatePropagation
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
preventDafault
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 20 - Event Listener and BOM 51
Window Size
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Location
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
History
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Navigator
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Popups
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 20 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 21 - HTML5 APIs and Ajax
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Geoloaction API
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Web Storage
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Localstorage
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
SessionStorage
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Web workers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
XMLHttpRequest or XHR
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 21 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 22 - JavaScript Oddities
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
JavaScript Oddities
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Equal comparison
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
[ ] == ![ ]
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
baNaNa
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Adding arrays
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
null is an object
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
try..catch finally
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Multiple inheritance
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
A class of class
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Tricky return
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 22 - JavaScript Oddities 57
Comparing null to 0
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Chapter 22 - Quiz
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.
Answers
This content is not available in the sample book. The book can be purchased on Leanpub at http:
//leanpub.com/learnjavascriptfrombeginnertomaster.