JavaScript
31.1K subscribers
1.22K photos
10 videos
33 files
894 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

class Range {
#start; #end;
constructor(start, end) { this.#start = start; this.#end = end; }
[Symbol.iterator]() {
let current = this.#start;
const end = this.#end;
return {
next() {
return current < end
? { value: current++, done: false }
: { value: undefined, done: true };
},
[Symbol.iterator]() { return this; }
};
}
}

const range = new Range(1, 5);
const arr1 = [...range];
const arr2 = [...range];
const sum = arr1.reduce((a, b) => a + b, 0);
console.log(arr1.join(','), arr2.join(','), sum);
1👍1
CHALLENGE

const log = [];

async function a() {
log.push('a-start');
await b();
log.push('a-end');
}

async function b() {
log.push('b-start');
await Promise.resolve();
log.push('b-end');
}

a();
log.push('sync-end');

setTimeout(() => console.log(log.join(',')), 0);
1🔥1
CHALLENGE

class Counter {
constructor() {
this.count = 0;
}
increment() {
this.count++;
return this.count;
}
}

const counter = new Counter();
const boundInc = counter.increment.bind(counter);
const rebind = boundInc.bind({ count: 100 });

console.log(boundInc(), rebind(), counter.count);
2👍2🔥2
What is the output?
Anonymous Quiz
37%
1 101 2
23%
1 2 1
25%
1 2 2
16%
1 1 1
🔥2
🌦 NestJS 12 Released with ESM-First Packages, Rspack and Vitest

The progressive framework gets its biggest release in years, going ESM-first (CJS is still an option), replacing webpack with Rspack, adding Standard Schema support for easy interop with Zod, Valibot and friends, plus structured logging, a brand new homepage, and more.

Kamil Mysliwiec
Please open Telegram to view this post
VIEW IN TELEGRAM
5🔥5👍2
CHALLENGE

class Base {
static count = 0;
static #secret = 42;
static {
Base.count = 10;
}
static getSecret() {
return this.#secret;
}
}

class Derived extends Base {
static count = Base.count + 5;
}

let result;
try {
result = Derived.getSecret();
} catch (e) {
result = e.constructor.name;
}

console.log(Base.count, Derived.count, result);
1👍1
4🔥3👍1
⛽️ Drydock: Diff Your npm Tarballs Before You Publish

From a Preact core team member comes a tool to diff built npm tarballs against the last published version, flagging install scripts, network access and new binaries. It can then gate your Actions publish job or watch npm's new staged publishing flow.

Jovi De Croock
Please open Telegram to view this post
VIEW IN TELEGRAM
👍42
CHALLENGE

class Timer {
#ticks = 0;
tick = () => {
this.#ticks++;
return this.#ticks;
};
reset() {
this.#ticks = 0;
return this.#ticks;
}
}

const t = new Timer();
const { tick, reset } = t;
let result;
try {
result = reset();
} catch (e) {
result = e.constructor.name;
}
console.log(tick(), tick(), result);
2👍2
1🤔1
👀 htmx 4.0 has landed, the first major release in two years, with lots of changes. It remains a neat way to add interactivity to server-rendered pages without reaching for a frontend framework.
Please open Telegram to view this post
VIEW IN TELEGRAM
3
CHALLENGE

function createCounters() {
const counters = [];
for (let i = 0; i < 3; i++) {
let count = 0;
counters.push(() => {
count += i;
return count;
});
}
return counters;
}

const counters = createCounters();
const first = counters.map(fn => fn()).join(',');
const second = counters.map(fn => fn()).join(',');
console.log(first, second);
2🔥1
👍1
🔥 The Depths of JavaScript: Minesweeper in 247 Bytes

An analysis of a playable 8x8 Minesweeper implementation in one line of JavaScript, complete with flags and cascading blank cells. The author's 658-byte version is impressive enough, but this post covers the tricks to make it 62% smaller than that!

yui and DNEK
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥72
👀 Uppy 6.0: A Modular JavaScript File Uploader

Resumable uploads from disk, Dropbox or GDrive, with wrappers for React, Vue, Svelte & Angular. This version focuses on clean-up, with a rewritten S3 plugin and fewer packages to manage.

Transloadit
Please open Telegram to view this post
VIEW IN TELEGRAM
🤔31👍1🔥1
🌲 A Recap of Node.js Interactive 2026

Node.js Interactive returned for the first time since 2019 as part of this month's RenderATL event with Node contributors and invited speakers tackling Node's near-term roadmap in areas like AI, supply chain security, WinterCG becoming Ecma TC55, work on QUIC and HTTP/3 support, and Node's move to one major release a year.

Aviv Keller
Please open Telegram to view this post
VIEW IN TELEGRAM
3👍1🔥1
CHALLENGE

class Base {
#value = 0;
get value() { return this.#value; }
set value(v) { this.#value = v * 2; }
}
class Derived extends Base {
get value() { return super.value + 1; }
set value(v) { super.value = v + 10; }
}
const d = new Derived();
d.value = 5;
console.log(d.value, d.value = 100, d.value);