JavaScript
32K subscribers
1.04K photos
10 videos
33 files
717 links
A resourceful newsletter featuring the latest and most important news, articles, books and updates in the world of #javascript 🚀 Don't miss our Quizzes!

Let's chat: @nairihar
Download Telegram
CHALLENGE

const weakMap = new WeakMap();
const obj = {};
const gen = (function* () {
yield 'value1';
yield 'value2';
})();

weakMap.set(obj, gen.next().value);

console.log(weakMap.get(obj));
console.log(gen.next().value);
👍4
👍114🤔4🔥3
😉 A day as a Remote Software Engineer in Helsinki, Finland

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🔥75🤔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);
👍75🔥3🤩2
👍10🔥6🤔54
✌️ ECMAScript Safe Assignment Operator Proposal

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🤔74🔥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🤔54🔥1
😭 ...
Please open Telegram to view this post
VIEW IN TELEGRAM
2🤣50👍85🔥1🤔1
Sponsored by Bryntum 👮‍♀️
World Class Web Components

CHALLENGE


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👍53
What is the output?
Anonymous Quiz
33%
undefined
32%
true
31%
false
4%
Error
👍1
Sponsored by Bryntum 👮‍♀️
World Class Web Components

🔥 Google takes its biggest L ever... now a convicted monopolist

Fireship
Please open Telegram to view this post
VIEW IN TELEGRAM
3🤣6🔥43👍2
Sponsored by Bryntum 👮‍♀️
World Class Web Components

CHALLENGE


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
What is the output?
Anonymous Quiz
45%
6
26%
[1, 2, 3]
16%
"123"
12%
Error
2👍108🔥3
Sponsored by Bryntum 👮‍♀️
World Class Web Components

😆 What about JavaScript?
Please open Telegram to view this post
VIEW IN TELEGRAM
2🤣466👍4🔥4
Sponsored by Bryntum 👮‍♀️
World Class Web Components

CHALLENGE


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🤔42
What is the output?
Anonymous Quiz
14%
Error
25%
"value"
42%
"eulav"
19%
undefined
3👍126🔥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
Please open Telegram to view this post
VIEW IN TELEGRAM
2👍52🔥2
Sponsored by Bryntum 👮‍♀️
World Class Web Components

CHALLENGE


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👍63🔥3🤔3
What is the output?
Anonymous Quiz
23%
[1, 2, 3]
20%
Error
10%
[]
47%
[2, 4, 6]
👍6
Sponsored by Bryntum 👮‍♀️
World Class Web Components

✌️ JavaScript Weekly #​701
Please open Telegram to view this post
VIEW IN TELEGRAM
2👍63🔥2