console.log(1 === '1')
difference between var, let, const
let i = 5
i--;
console.log(i);
function F(x){
this.x = x;
}
var inst = new F(3);
var result = inst.getSumm(2); // => 5
console.log(result) // => 5
console.log(inst.x) // => undefined
var arr = []
console.log(Boolean(arr.length));
apply, call, slice, splice, shift, split, join, reverse, replace, filter, find, reduce, Prototype?
replace all A to B
"ABBBABBBAAA"
Make it work
var arr = ['a', 'b', 'c'];
for(var a=0;a<arr.length;a++){
setTimeout(function(){
console.log('a', a, arr[a]);
}, 1);
}
let obj = {'1': 0, 1: 1, 0: 2};
alert(obj['1']);
sayHi();
function sayHi() {
alert("Hello");
}
let obj = {
"0": 1,
0: 2
};
alert( obj["0"] + obj[0] );
function func(){
var f = function(){
return 1;
}
function f(){ return 2; }
return f();
}
console.log(func());
var obj = {x:1}
function func(obj){
return obj.x
}
setTimeout(() => {
obj.x = 2;
}, 0);
console.log(func(obj));
function a(){
//
}
console.log(a(1)(2)) // => 3
console.log(a(1)(2)(3)) // => 6