CHALLENGE β
const person = {
name: "John",
greet: function() {
const getMessage = () => `Hello, ${this.name}`;
return getMessage();
}
};
console.log(person.greet());
Please open Telegram to view this post
VIEW IN TELEGRAM
π8β€2
What is the output?
Anonymous Quiz
20%
Hello, undefined
65%
Hello, John
10%
Hello, [object Object]
5%
Error
π7π₯6π€4β€2
CHALLENGE β
const animal = {
sound: "Generic sound",
makeSound() {
return this.sound;
}
};
const dog = Object.freeze(Object.create(animal));
dog.sound = "Bark";
const result = dog.makeSound();
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
π10β€8
π7π₯7β€5π€3
Weβre not just talking the obvious like + and - but things like βΏβ, Ξ£, Ξ , β, and set notation.
Joshua Nussbaum
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯7π3β€2
CHALLENGE β
var a = 5;
function test() {
console.log(a);
var a = 10;
console.log(a);
}
test();
Please open Telegram to view this post
VIEW IN TELEGRAM
π17
π€£42π€18π15π₯5β€1
Available in the form of React/Preact, Vue, Svelte, Angular, or plain JS components. Open source but with a premium version with extra features. GitHub repo.
Tom Γsterlund
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯6π5β€2
CHALLENGE β
const original = Object.freeze({ a: [1, 2, 3] });
const copy = { ...original };
copy.a.push(4);
console.log(original.a);
console.log(copy.a);
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯5π1
What is the output?
Anonymous Quiz
48%
[1, 2, 3], [1, 2, 3, 4]
28%
[1, 2, 3, 4], [1, 2, 3, 4]
7%
[1, 2, 3, 4], [1, 2, 3]
16%
[1, 2, 3], [4]
π€23π₯11π6β€4π€£2π€©1
AbortController is a broadly available mechanism for, originally, aborting Web requests on demand, but you can use it for a lot more than that (or βanything!β, as Artem explains).
Artem Zakharchenko
Please open Telegram to view this post
VIEW IN TELEGRAM
π6β€3π₯1
CHALLENGE β
const promise = new Promise((resolve) => {
console.log('Promise started');
setTimeout(() => {
resolve('Promise resolved');
}, 100);
});
promise.then((result) => {
console.log(result);
});
console.log('End of script');
Please open Telegram to view this post
VIEW IN TELEGRAM
π5
Itβs not Express, but a reimplementation of Expressβs functionality with API compatibility. Based on Β΅WebSockets, and with an optimized router, it boasts faster performance than regular Express, but needs some C++ magic to make it happen.
dimden
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯3π2β€1
CHALLENGE β
const obj = {
value: 100,
method: function() {
const inner = function() {
console.log(this.value);
};
inner();
}
};
obj.method();
Please open Telegram to view this post
VIEW IN TELEGRAM
π€10π6
π€14π8π₯7β€3
Whatβs the next step up from colorizing the text output of your Node-powered CLI app? Gradients. v3.0 is rewritten in TypeScript and is a pure ES module.
Boris K
Please open Telegram to view this post
VIEW IN TELEGRAM
π5β€3π₯2π€©1
CHALLENGE β
function* generatorFunction() {
yield 1;
yield* function* () {
yield 2;
yield 3;
}();
yield 4;
}
const gen = generatorFunction();
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
Please open Telegram to view this post
VIEW IN TELEGRAM
π5π€©2π₯1
What is the output?
Anonymous Quiz
23%
1, 2, 3, undefined, 4
20%
1, 3, 4, undefined, undefined
13%
1, 2, 3, undefined, undefined
44%
1, 2, 3, 4, undefined
π11β€5π₯1
Please open Telegram to view this post
VIEW IN TELEGRAM
π€£101π€8π₯7π€©4π2