Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
β€3π2π₯2
CHALLENGE
const sym1 = Symbol('sym');
const sym2 = Symbol('sym');
const obj = {
[sym1]: 'value1',
[sym2]: 'value2'
};
console.log(obj[sym1], obj[sym2], sym1 === sym2);
π5β€3
What is the output?
Anonymous Quiz
25%
value1, value1, true
15%
value1, value1, false
48%
value1, value2, false
12%
undefined, undefined, false
β€20π8π€2
A library for rendering and working with infinitely pannable canvases that contain βsmart shapesβ that you can script and give various constraints and properties. GPLv3 licensed.
Minkyu Lee
Please open Telegram to view this post
VIEW IN TELEGRAM
β€2π₯2π1
CHALLENGE
function* generator() {
yield 1;
yield 2;
yield 3;
}
const gen = generator();
const { value, done } = gen.return('early');
console.log(value, done);
π€7π4β€2π₯1
π6π€2β€1
An interesting new VS Code extension that offers 11 different ways to make variable names stand out more in your editor, with both basic colorization approaches and an interesting emoji-based prefix option.
Ting Wei Jing
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯3β€1π1
CHALLENGE
const sym = Symbol('unique');
const obj = {
[sym]: 'symbol value',
a: 1,
b: 2
};
const keys = Object.keys(obj);
const symbols = Object.getOwnPropertySymbols(obj);
console.log(keys.length, symbols.length);
π10β€1
π8β€2π₯1π€1
You read a book and enthusiastically highlighted every sentence. But letβs be honest, how often have you actually gone back to review those highlights? Probably not very often, if at all.
Hovhannes Dallakyan
Please open Telegram to view this post
VIEW IN TELEGRAM
π11β€5π₯2
CHALLENGE
const obj = {
value: 1,
method() {
return this.value;
}
};
const boundMethod = obj.method.bind({ value: 2 });
console.log(boundMethod());
π9
π10β€6π€5
Please open Telegram to view this post
VIEW IN TELEGRAM
β€4π4π₯2
CHALLENGE
const obj1 = { a: 1 };
const obj2 = { b: 2 };
Object.setPrototypeOf(obj2, obj1);
console.log('a' in obj2);
console.log(obj2.hasOwnProperty('a'));
console.log(obj2.__proto__.a);
π5
What is the output?
Anonymous Quiz
19%
false, true, 1
32%
false, false, 1
30%
true, false, 1
19%
true, true, 1
π8β€3π₯2
CHALLENGE
async function asyncFunc() {
return 'async';
}
function promiseFunc() {
return new Promise(resolve => resolve('promise'));
}
(async function() {
const result = await (true ? asyncFunc() : promiseFunc());
console.log(result);
})();
π7
π7β€5π₯5π€2
One of those releases where lots of tiny things have occurred, but little of broad significance, exceptβ¦ for snapshot testing! Snapshot tests serialize arbitrary values into string values to be compared against a set of pre-built known βgoodβ values (stored as a βsnapshotβ representing a desired state).
Rafael Gonzaga
Please open Telegram to view this post
VIEW IN TELEGRAM
π7β€3π€©2
CHALLENGE
const obj1 = {
a: 1,
method() {
return this.a;
}
};
const obj2 = Object.create(obj1);
obj2.a = 2;
console.log(obj2.method());
π₯7π1π€©1
π₯8π€7π4β€3