Telegram Web
πŸ˜†
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣55❀5🀩4πŸ‘2
CHALLENGE

function* generateSequence() {
let i = 1;
while (i <= 3) {
yield i++;
}
}

function* extendSequence() {
yield* generateSequence();
yield* [4, 5];
yield 6;
}

const generator = extendSequence();
const result = [];

for (const value of generator) {
if (value % 2 === 0) {
result.push(value * 2);
} else {
result.push(value);
}
}

console.log(result);
❀1
πŸ‘6πŸ”₯5❀2πŸ€”1
πŸ™‚ Fastify + React – 7x Faster than Next.js?

Node’s Fastify framework has a mature plugin for Vite integration (explained in detail here), including @fastify/react which just hit version 1.0 and makes it easy to create fast, featureful (though obviously less so than Next.js) React apps atop Fastify. How fast? Very, it seems.

Jonas Galvez
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ€”6❀3πŸ‘2πŸ”₯1
CHALLENGE

const privateData = new WeakMap();

function Person(name) {
privateData.set(this, { name, secretCount: 0 });

this.greet = function() {
const data = privateData.get(this);
data.secretCount++;
return `Hello, my name is ${data.name}`;
};

this.getSecretCount = function() {
return privateData.get(this).secretCount;
};
}

const alice = new Person('Alice');
alice.greet();
alice.greet();

const result = [
privateData.has(alice),
alice.name,
alice.getSecretCount()
];

console.log(result);
πŸ‘4❀1
1πŸ‘5❀2πŸ”₯1
🀟 Lexe: Package a Node App into a Single Executable

Node actually has a mechanism for creating single executable applications and there are numerous other tools to do it, but Lexe takes the approach of using Amazon’s lightweight LLRT engine to make binaries of under 10MB in size. Note, however, "Lexe is not a drop-in replacement for Node.js. It only supports a subset of Node.js APIs."

Ray-D-Song
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘6❀3πŸ”₯1
Please open Telegram to view this post
VIEW IN TELEGRAM
2🀣36❀4πŸ”₯4πŸ‘1
CHALLENGE

const user = {
name: 'Alice',
age: 30
};

const handler = {
get(target, prop) {
if (prop in target) {
return target[prop];
}
return `Property '${prop}' doesn't exist`;
},
set(target, prop, value) {
if (prop === 'age' && typeof value !== 'number') {
console.log('Age must be a number');
return false;
}
target[prop] = value;
return true;
}
};

const proxy = new Proxy(user, handler);
proxy.age = '32';
proxy.age = 32;
console.log(proxy.job);
πŸ‘7❀3
πŸ˜†
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣44πŸ‘12❀2πŸ”₯1πŸ€”1
CHALLENGE

function executePromises() {
console.log(1);

setTimeout(() => {
console.log(2);
}, 0);

Promise.resolve().then(() => {
console.log(3);
setTimeout(() => {
console.log(4);
}, 0);
}).then(() => {
console.log(5);
});

console.log(6);
}

executePromises();
πŸ”₯3❀2πŸ‘1
πŸ‘6🀩5❀2πŸ”₯1
✌️ The ECMAScript Records and Tuples Proposal Has Been Withdrawn

Several years in the making, the record and tuples proposal offered two new deeply immutable data structures to JavaScript, but at this week’s TC39 meeting, the consensus was to drop it.
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘7πŸ€”4🀣3❀2πŸ”₯1
CHALLENGE

function main() {
console.log(1);

setTimeout(() => console.log(2), 0);

Promise.resolve().then(() => {
console.log(3);
setTimeout(() => console.log(4), 0);
}).then(() => console.log(5));

Promise.resolve().then(() => console.log(6));

console.log(7);
}

main();
❀5πŸ‘2
πŸ‘5πŸ”₯3❀2
πŸ‘ A Flowing WebGL Gradient, Deconstructed

Even if you don’t want to render a neat plasma-style effect on the Web, this is a wonderfully deep exploration of the math and technology behind doing so using simple GLSL code that could be easily understood by any JavaScript developer.

Alex Harri
Please open Telegram to view this post
VIEW IN TELEGRAM
❀3πŸ‘2🀣2
CHALLENGE

const team = {
members: ['Alice', 'Bob', 'Charlie'],
[Symbol.iterator]: function*() {
let index = 0;
while(index < this.members.length) {
yield this.members[index++].toUpperCase();
}
}
};

const result = [];
for (const member of team) {
result.push(member);
}

console.log(result.join('-'));
πŸ‘4
πŸ‘9❀2πŸ”₯2
Please open Telegram to view this post
VIEW IN TELEGRAM
1❀10πŸ‘2πŸ”₯2
2025/07/13 06:59:13
Back to Top
HTML Embed Code: