JavaScript
32.1K subscribers
1.04K photos
10 videos
33 files
723 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
🀣19πŸ€”9🀩7πŸ‘5πŸ”₯3
πŸ‘€ How 1Password Used esbuild to Cut Browser Extension Build Times

1Password is a popular password management tool that relies upon a browser extension to fill out passwords on the Web. At over a minute for a single build, things were starting to drag for the devs. Could esbuild help? A fun story with plenty of technical details.

Jarek Samic
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯5πŸ‘4❀1
CHALLENGE

function* generator() {
yield 1;
yield* [2, 3];
yield 4;
}

const gen = generator();
for (const value of gen) {
console.log(value);
}
❀3πŸ‘2
What is the output?
Anonymous Quiz
14%
1, 4
11%
1, 2, 3
69%
1, 2, 3, 4
5%
2, 3, 4
πŸ‘11❀4🀩2
✌️ Regexper: Display JavaScript Regular Expressions as Railroad Diagrams

Might come in handy for learning regular expressions or if you have a complex regular expression and you don’t know what it does (not an uncommon situation..!)

Jeff Avallone
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯6❀1πŸ‘1
CHALLENGE

function* generator1() {
yield 1;
yield 2;
}

function* generator2() {
yield* generator1();
yield 3;
}

const gen = generator2();
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
πŸ‘5❀3🀩1
🀩15πŸ‘8❀7
🍊 Qlock: A JavaScript Quine Clock

We linked to Martin's array of creative JavaScript experiments earlier, but why not finish with one that particularly tickled us? A quine is a program that takes no input but manages to produce, as output, its own source code. Here’s a fun JavaScript example that isn’t merely a quine, but a clock too.

Martin Kleppe
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯6❀5πŸ‘4πŸ€”1
CHALLENGE

function* generator() {
const value = yield 1;
yield value;
}

const gen = generator();
console.log(gen.next().value);
console.log(gen.next(2).value);
πŸ‘4πŸ€”2
❀13πŸ€”7🀣2🀩1
Please open Telegram to view this post
VIEW IN TELEGRAM
❀3πŸ‘2
CHALLENGE

function* generator() {
yield 1;
yield 2;
return 3;
}

const gen = generator();
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
πŸ‘2πŸ”₯2
πŸ”₯11❀4πŸ‘4πŸ€”4
Even though Armenia πŸ‡¦πŸ‡² is a small country, we have a really big JavaScript community 😎.
There are many events related to JavaScript, and another one is happening tomorrow: JSConf Armenia 2024!

If you are in Armenia and would like to attend, just grab your tickets from the website.
❀17πŸ‘7🀣7πŸ”₯4
CHALLENGE

function* generator() {
yield 1;
yield new Promise(resolve => resolve(2));
yield 3;
}

const gen = generator();
console.log(gen.next().value);
gen.next().value.then(console.log);
console.log(gen.next().value);
πŸ‘5🀩2❀1
πŸ‘9πŸ”₯8❀4
✌️ Promises from the Ground Up

Josh notes that in order to truly understand promises, a fundamental part of modern JS development, we need β€œa surprisingly deep understanding of how JavaScript works and what its limitations are”. Luckily, this tutorial covers all the critical context you need.

Josh W Comeau

πŸ‘€ If you're a bit more advanced, you might enjoy Alex MacArthur's look at controlling promises using Promise.withResolvers().
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘8❀2πŸ”₯2
✌️ SOME UPDATES

JavaScript Weekly
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘7
CHALLENGE

let obj1 = { key: 'value1' };
let obj2 = { key: 'value2' };

const map = new Map();
const weakMap = new WeakMap();

map.set(obj1, 'mapValue');
weakMap.set(obj2, 'weakMapValue');

obj1 = null; // Changing reference
obj2 = null; // Changing reference

console.log(map.has(obj1));
console.log(weakMap.has(obj2));
❀7πŸ‘4πŸ”₯4
πŸ€”22πŸ”₯4🀣4πŸ‘3❀2
CHALLENGE

function* genFunc() {
yield Symbol('A');
yield new Function('return this')();
}

const obj = { key: genFunc().next().value };
obj.key = genFunc().next().value;

console.log(obj.key === globalThis);
πŸ€”5❀4πŸ”₯2πŸ‘1