Interview Javascript
Interview Javascript
of Contents
Introduction 1.1
1
Introduction
let dog = {
name: 'doggo',
sayName() {
console.log(this.name);
}
}
2
Introduction
function Dog(name) {
this.name = name;
}
Dog.bark = function() {
console.log(`${this.name} says woof`);
}
function isBig(thing) {
if (thing == 0 || thing == 1 || thing == 2) {
return false;
}
return true;
}
console.log(isBig(1));
console.log(isBig([2]));
console.log(isBig([3]));
let a={};
let b={key:'b'};
let c={key:'c'};
a[b]=123;
a[c]=456;
console.log(a[b]);
3
Introduction
add(2)(3)(); // 5;
isThreePassed(1,2); // false
isThreePassed(9,3,4,9); // true
function *foo(x) {
var y = 2 * (yield (x + 1));
var z = yield (y / 3);
return (x + y + z);
}
var it = foo(5);