JS Core 1
Basic setup
IDE/Text Editor


WEB STORM
SUBLIME TEXT 3
Keys/values & Objects
var Bionic_address = 'Gr. Skovorody 12b'
Object - collection of name-values pairs
var bionic_university = {
adress: {
country: 'Ukraine',
city: 'Kyiv',
street 'Skovoroda'
},
students: ['student1', 'student2','student3','student5'],
addStudent: function (student) {
// Do some stuff with new student
}
}
Global execution environment
Global ~ not in function
Global execution context
Global object
(window)
this
Execution context & variable hoisting
Undefined vs Undeclared
Function invocation & Execution stack
Global execution context
function a() {
b();
}
function b() {
c();
}
function d() {
c();
}
function c() {
console.log('Finish chain');
}
a();
a()
Execution context
b()
Execution context
c()
Execution context
d()
Execution context
Variable environment
function b() {
var myVar;
console.log(myVar);
}
function a() {
var myVar = 2;
console.log(myVar);
b();
}
var myVar = 1;
console.log(myVar);
a();
console.log(myVar);
Global execution context
myVar = 1
a() Execution context
myVar = 2
b() Execution context
myVar = undefined
Scope chain
function b() {
console.log(myVar);
}
function a() {
var myVar = 2;
b();
}
var myVar = 1;
a();
Global execution context
myVar = 1
a() Execution context
myVar = 2
b() Execution context
?

log: 1
var myVar;
function a() {
var myVar;
function b() {
console.log(myVar);
}
myVar = 12;
b();
myVar = 4;
}
myVar = 1;
a();
myVar = 2;
log ....?
12
Event queue
Global execution environment
Execution Context
Hoisting
Undefined & undeclared
Function invocation
Execution stack
Variable environment
Scope chain
JS Core 1
By Mikki Churilov
JS Core 1
- 729