What is the output?
Anonymous Quiz
17%
Error
27%
"valie1", undefined
46%
"value1", "value2"
10%
"value2", "value2"
👍11❤4🤔4🔥3
I've always wanted to create a video series to share my experiences and work style as a remote software engineer. I finally started this journey and am excited to make more videos like this...
nairi
Please open Telegram to view this post
VIEW IN TELEGRAM
1👍18🔥7❤5🤔2🤩1
CHALLENGE
const weakMap = new WeakMap();
const gen = (function* () {
yield { key: 'value1' };
yield { key: 'value2' };
})();
const obj1 = gen.next().value;
const obj2 = gen.next().value;
weakMap.set(obj1, 'stored value1');
weakMap.set(obj2, 'stored value2');
const result = [...gen].map(obj => weakMap.get(obj));
console.log(result);
👍7❤5🔥3🤩2
What is the output?
Anonymous Quiz
17%
[undefined, undefined]
17%
[]
58%
["stored value1", "stored value2"]
9%
[null, null]
👍10🔥6🤔5❤4
We often feature ECMAScript proposals that are in their later stages, but how about a brand new one you could get involved with? This one proposes an interesting additional bit of language syntax (`?=`) that returns a
[error, value]
tuple from an assignment.Arthur Fiorette
Please open Telegram to view this post
VIEW IN TELEGRAM
2👍7🤔7❤4🔥2
CHALLENGE
const weakMap = new WeakMap();
const array = [{}, {}];
array.forEach(obj => weakMap.set(obj, obj));
const result = array.map(obj => weakMap.get(obj) === obj);
console.log(result);
2👍8
👍11🤔5❤4🔥1
Sponsored by Bryntum 👮♀️
World Class Web Components
❓ CHALLENGE
World Class Web Components
const weakMap = new WeakMap();
const obj = {};
(function() {
const internalObj = {};
weakMap.set(internalObj, 'hidden');
obj.ref = internalObj;
})();
delete obj.ref;
const result = weakMap.has(obj.ref);
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
2🔥7🤔6👍5❤3
👍1
Sponsored by Bryntum 👮♀️
World Class Web Components
🔥 Google takes its biggest L ever... now a convicted monopolist
Fireship
World Class Web Components
Fireship
Please open Telegram to view this post
VIEW IN TELEGRAM
3🤣6🔥4❤3👍2
Sponsored by Bryntum 👮♀️
World Class Web Components
❓ CHALLENGE
World Class Web Components
const weakMap = new WeakMap();
const array = [1, 2, 3];
const obj = {};
weakMap.set(obj, array);
const result = weakMap.get(obj).reduce((acc, val) => acc + val);
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
👍7
2👍10❤8🔥3
Sponsored by Bryntum 👮♀️
World Class Web Components
❓ CHALLENGE
World Class Web Components
const weakMap = new WeakMap();
const obj1 = {};
const obj2 = { key: 'value' };
weakMap.set(obj1, obj2);
const result = weakMap.get(obj1).key.split('').reverse().join('');
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
👍8🤔4❤2
3👍12❤6🔥3🤔1
Sponsored by Bryntum 👮♀️
World Class Web Components
👍 Volta 2.0: Install and Run JavaScript Tools Quickly
A long-standing Rust powered tool for installing and switching JavaScript related tools (like Node, TypeScript, Yarn, etc.) … “no matter the package manager, Node runtime, or OS.” GitHub repo.
Volta
World Class Web Components
A long-standing Rust powered tool for installing and switching JavaScript related tools (like Node, TypeScript, Yarn, etc.) … “no matter the package manager, Node runtime, or OS.” GitHub repo.
Volta
Please open Telegram to view this post
VIEW IN TELEGRAM
2👍5❤2🔥2
Sponsored by Bryntum 👮♀️
World Class Web Components
❓ CHALLENGE
World Class Web Components
const weakMap = new WeakMap();
const objs = [{}, {}, {}];
objs.forEach((obj, index) => weakMap.set(obj, index + 1));
const result = objs.filter(obj => weakMap.has(obj)).map(obj => weakMap.get(obj) * 2);
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
2👍6❤3🔥3🤔3
👍6