Владимир Дашукевич
Владимир Дашукевич
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+[+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]])()
function(){
var a = 2;
if (true) {
var b = 3;
}
return a + b;
}
function(){
let a = 2;
if (true) {
let b = 3;
}
return a + b; //???
}
function(){
let a = 2;
if (true) {
let b = 3;
}
return a + b; // ReferenceError
}
function(){
for (let i = 0; i < 6; i++) {
setTimeout(() => { console.log(i) }, 1); // ???
}
}
function(){
for (let i = 0; i < 6; i++) {
setTimeout(() => { console.log(i) }, 1); // 1, 2, 3, 4, 5
}
}
function(){
a; // ???
b; // ???
var a = 1;
var b = 3;
var c = a + b;
}
a;
b;
var a = 1;
var b = 3;
var c = a + b;
a;
b;
var a = 1;
var b = 3;
var c = a + b;
a;
b;
var a = 1;
var b = 3;
var c = a + b;
a;
b;
var a = 1;
var b = 3;
var c = a + b;
var a;
var b;
var c;
a;
b;
a = 1;
b = 3;
c = a + b;
a; // undefined
b; // undefined
var a = 1;
var b = 3;
var c = a + b;
a; // ReferenceError
b; // ReferenceError
let a = 1;
let b = 3;
let c = a + b;
let a = 1;
let a = 3; // Error
var a = 3; // Error
var b = 3;
let b = 3; // Error
const a = 1;
a = 3; //Error
const a = [1, 2, 3];
a[1] = "Hello"; // a -> [1, "Hello", 3]
var sum = {
sum: 0,
add: function(num){
this.sum += num;
},
inc: function(){
this.sum++;
}
}
sum.add(5); //sum.sum === 5
sum.inc(); //sum.sum === 6
elem.addEventListener("click", sum.inc, false); // Error
elem.addEventListener("click", sum.inc.bind(sum), false);
var sum = {
sum: 0,
add: (function(num){
this.sum += num;
}).bind(sum),
inc: (function(){
this.sum++;
}).bind(sum)
}
var sum = {
sum: 0,
add: () => {
this.sum += num;
},
inc: () => {
this.sum++;
}
}
model.user = {
find:function(){ ... },
findFirst: function(){
return new Promise((resolve, reject) => {
this.find(...);
})
}
}
elem.addEventListener("click", e => {
this.doSomething();
});
(() => this.outerWidth).apply({ outerWidth: 20 }); // ???
(() => this.outerWidth).bind({ outerWidth: 20 })(); // ???
(() => arguments[0])(1, 2, 3, 4); // ???
var foo = function(a, ...rest){
rest.forEach(function(a){
console.log(a)
})
});
foo(1, 2, 3); // 2, 3
foo(1, 2, 3, 4); // 2, 3, 4
foo();//
function foo(x,y) {
x = x || 11;
y = y || 31;
console.log( x + y );
};
function foo(x = 11, y = 31) {
console.log( x + y );
};
let a = 10;
function foo(x = a + 1, y = bar(), z = x + 2) {
console.log( x + y );
};
let a = 10;
function foo(x = a + 1, y = bar(), z = x + 2) {
console.log( x + y );
};
let a = 10;
function foo(x = a + 1, y = bar(), z = x + 2) {
console.log( x + y );
};
let a = 10;
function foo(func = (function(){ return "hello"; })()) {
console.log( x + y );
};
let [x, y] = [1, 2]
let [,, y] = [1, 2, 3]
let {x, y} = foo();
let {x = 31, y} = foo();
let {a: x, b: y} = {a: 1, b: 2}
let {a: {x: X, x: Y}, a } = {a: {x: 1}};
function foo({x: a, y: b}) {
console.log( a + b );
};
Promise.all([...]).then([users, routes, hotels]) {
...
};
var a = [2,3,4];
var b = [ 1, ...a, 5 ]; // [1,2,3,4,5]
let name = "Vladimir"
let a = `My name is ${ name }`;
let name = "Vladimir"
let a = `My name
is ${ name }`;
let foo = (strings, ...value) => { ... }
let a = foo`My name is ${ name }`;
let foo = (strings, ...value) => { ... }
let a = foo`My name is ${ name }!`;
let foo = (strings, ...value) => { ... }
let a = foo`My name is ${ name + "'s" }!`;
let s = Symbol("Login")
typeof s === "symbol"
s.toString(); //Symbol(Login)
{ [s]: "property that can only be assecced through Symbol" }
const s = Symbol.for("Login")
s === Symbol.for("Login")
Symbol.keyFor(a) // "Login"
class a {
constructor(){ ... }
get prop(){ return "hello" }
set prop(val){ ... }
}
class b extend a {
constructor(){ super(...) }
}
class b extend a {
constructor(){ new.target }
}
class B {
static doWork(){ return "done"; }
}
B a = new B();
a.doWork(); // done
B.doWork(); // done
let a = new B();
a.doWork(); // ReferenceError
B.doWork(); // done
var a = class b{}
typeof a; // ???
typeof b; // ???
(function(){
var a;// private
return {
doWork: function(){ ... }
}
})();
export {a: 1, foo}
import {a} as value from "module.js"
var gen = function* count(){
for (var x = 0; true; x++) {
yield x
}
}
var a = gen()
a.next(); // => 0
a.next(); // => 1
a.next(); // => 2
function* showFeed(){
var countries = yield getCountries();
renderCountries(countries);
var hotels = yield getHotels(countries);
renderHotels(hotels);
var rooms = yield getRooms(hotels);
renderRooms(rooms);
}