JavaScript
32K subscribers
1.04K photos
10 videos
33 files
716 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
✌️ 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
Sponsored by Bryntum 👮‍♀️
World Class Web Components

🌲 Node.js Security release process

Only those who have been involved in a security release process know how hard it is (time-consuming, effort).
We've been working hard to automate most (if not all) of the process and the new security release process is live

Rafael Gonzaga
Please open Telegram to view this post
VIEW IN TELEGRAM
24👍3🔥2
Sponsored by Bryntum 👮‍♀️
World Class Web Components

CHALLENGE


const obj = {
a: 1,
b: 2
};

let a = 10;
let b = 20;

with (obj) {
a += 1;
b += 1;
}

console.log(a, obj.a, b, obj.b);
Please open Telegram to view this post
VIEW IN TELEGRAM
🤔11👍31
2🔥13👍7🤔43
Sponsored by Bryntum 👮‍♀️
World Class Web Components

CHALLENGE


const obj1 = {
name: "Alice",
age: 25
};

const obj2 = {
age: 30,
city: "Wonderland"
};

with (obj1) {
with (obj2) {
name = "Bob";
console.log(name, age);
}
}
Please open Telegram to view this post
VIEW IN TELEGRAM
🤔9🤩7👍51
2👍14🤔7🔥53