Skip to content

Instantly share code, notes, and snippets.

@completejavascript
Last active May 17, 2018 07:43
Show Gist options
  • Save completejavascript/1f59ed9f06730e24864c98dc17c24ee8 to your computer and use it in GitHub Desktop.
Save completejavascript/1f59ed9f06730e24864c98dc17c24ee8 to your computer and use it in GitHub Desktop.
Fun quiz!!!
let person = {
name : 'Bob',
sayName : function() {
setTimeout(function() {
console.log(`I'm ${this.name}`);
}, 1000);
}
};
person.sayName();
let person = {
name : 'Bob',
sayName : () => {
setTimeout(() => {
console.log(`I'm ${this.name}`);
}, 1000);
}
};
person.sayName();
let person = {
name : 'Bob',
sayName : function() {
setTimeout(() => {
console.log(`I'm ${this.name}`);
}, 1000);
}
};
person.sayName();
let person = {
name : 'Bob',
sayName : () => {
setTimeout(function() {
console.log(`I'm ${this.name}`);
}, 1000);
}
};
person.sayName();
(function(foo) {
console.log(typeof foo);
})([1, 2, 3]);
// Cách 1:
function func() {}
// Cách 2:
let func = function() {}
let cat = function() {
return
{
say: 'meow'
}
}
console.log(Math.max());
console.log(0 + '0');
console.log(0 - '0');
console.log(0 * '0');
console.log(0 / '0');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment