JavaScript
32K subscribers
1.03K photos
10 videos
33 files
715 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
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

โ“ CHALLENGE


const weakMap = new WeakMap();
const arr = [{}, {}, {}];

arr.forEach((obj, index) => weakMap.set(obj, index));

arr.splice(1, 1); // Remove the second element

const result = arr.map(obj => weakMap.get(obj));

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘5๐Ÿ”ฅ2โค1
๐Ÿ‘8๐Ÿคฉ4โค1๐Ÿ”ฅ1
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

๐ŸŒฒ How to Create an NPM Package in 2024

Sounds simple, but there are a lot of steps involved if you want to follow best practices, introduce useful tools, and get things just right. Matt Pocock walks through the process here, and thereโ€™s a 14-minute screencast too, if youโ€™d prefer to watch along.

Matt Pocock
Please open Telegram to view this post
VIEW IN TELEGRAM
1โค3๐Ÿ‘3๐Ÿ”ฅ1
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

โœŒ๏ธ JS Dates are About to Be Fixed

Handling dates and times is famously a painful area for programmers and JavaScript hasnโ€™t done a lot to make it easier. Libraries like Moment.js help a lot, but Iago looks at how the Temporal proposal and its features will begin to help a lot more over time.

Iago Lastra
Please open Telegram to view this post
VIEW IN TELEGRAM
2โค3๐Ÿ‘3๐Ÿ”ฅ1
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

โ“ CHALLENGE

const obj = {
outer: 1,
inner: {
outer: 10,
inner: 20
}
};

let result = 0;

with (obj) {
result += outer;
with (inner) {
result += outer + inner;
}
}

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘5๐Ÿค”2
What is the output?
Anonymous Quiz
58%
31
17%
21
9%
11
16%
30
2๐Ÿ”ฅ9โค6๐Ÿ‘6
โ“ CHALLENGE

const numbers = [0,0,0];

let i = 0;
const result = numbers.reduce((acc, _) => {
return ++acc;
}, i);

console.log(i, result);
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘3
What is the output?
Anonymous Quiz
38%
0 0
17%
3 3
8%
3 2
37%
0 3
3โค12๐Ÿ‘8๐Ÿค”8๐Ÿ”ฅ2
๐ŸŠ Rspack 1.0: The Rust-Powered JavaScript Bundler

Far from being โ€˜yet another bundlerโ€™ with its own approach and terminology to learn, Rspack prides itself on being webpack API and ecosystem compatible, while offering many times the performance. The team now considers it production ready and encourages you to try your webpack-based projects on it.

Rspack Contributors
Please open Telegram to view this post
VIEW IN TELEGRAM
โค3๐Ÿ‘2๐Ÿ”ฅ1
CHALLENGE

function createCounter() {
let count = 0;
return {
increment() {
count++;
return count;
},
getCount() {
return count;
}
};
}

const counter = createCounter();

console.log(counter.increment());
console.log(counter.getCount());
console.log(counter.increment());
console.log(counter.getCount());
๐Ÿ‘7โค4๐Ÿ”ฅ3
โค10๐Ÿ‘7๐Ÿ”ฅ1
๐Ÿ˜† So true ...
Please open Telegram to view this post
VIEW IN TELEGRAM
2๐Ÿคฃ47โค7๐Ÿ”ฅ6
CHALLENGE

const obj = {
a: 1,
b: 2,
getSum() {
return this.a + this.b;
}
};

const cloneObj = { ...obj, getSum() { return this.b + this.a; } };

console.log(obj.getSum());
console.log(cloneObj.getSum());
๐Ÿคฃ11๐Ÿ”ฅ3
What is the output?
Anonymous Quiz
13%
1, 2
72%
3, 3
10%
3, 5
4%
3, 7
2โค9๐Ÿ‘3๐Ÿ”ฅ2
Material UI v6 is out now ๐ŸŽ‰

At ten years old, the popular design system has its latest major release. There's a focus on improved theming, color scheme management, container queries, and React 19 support. There are revamped templates to be inspired by, too.

Garcรญa, Bittu, Andai, et al.
Please open Telegram to view this post
VIEW IN TELEGRAM
2โค3๐Ÿ‘3๐Ÿ”ฅ2๐Ÿคฃ1
CHALLENGE

const obj = {
value: 42,
getValue() {
return Math.max(this.value, 50);
}
};

const obj2 = {
value: 25,
getValue: obj.getValue
};

console.log(obj.getValue());
console.log(obj2.getValue());
โค8๐Ÿ‘2
What is the output?
Anonymous Quiz
56%
50, 50
17%
42, 50
18%
42, 25
9%
50, 42
2๐Ÿ”ฅ9๐Ÿ‘3โค1
Please open Telegram to view this post
VIEW IN TELEGRAM
๐Ÿ‘3โค2๐Ÿ”ฅ2
Help us improve our newsletter by rating your experience from 1 to 5. Your input is invaluable in helping us deliver the best content possible!
๐Ÿ‘11
We Want Your Feedback!
Anonymous Poll
14%
1
12%
2
18%
3
20%
4
35%
5