JavaScript
31.9K subscribers
1.01K photos
9 videos
33 files
693 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
πŸ”₯11πŸ€”10πŸ‘4❀2🀣2
Media is too big
VIEW IN TELEGRAM
😱 Multiple Window 3D Scene using Three.js

A quick example of how one can "synchronize" a 3d scene across multiple windows using three.js and localStorage

bgstaal
Please open Telegram to view this post
VIEW IN TELEGRAM
❀19πŸ”₯13🀩5🀣2πŸ€”1
CHALLENGE

function* range(start, end) {
let current = start;
while (current <= end) {
if (current % 3 === 0) {
current++;
continue;
}
yield current++;
}
}

const gen = range(4, 10);
const result = [...gen];
console.log(result);
πŸ‘5
❀12πŸ”₯5πŸ€”4🀣2πŸ‘1
CHALLENGE

async function demo() {
console.log('1');

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

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

await Promise.resolve();
console.log('5');

queueMicrotask(() => console.log('6'));
}

demo();
console.log('7');
πŸ‘12πŸ”₯3❀1
πŸ€”7πŸ”₯5❀1πŸ‘1
πŸ₯Ά Announcing TypeScript 5.8

Four months in the making, TypeScript 5.8 lands with a strong Node focus. You can now use require() for ES modules in the nodenext module, there’s a new node18 module for developers who want to keep targeting Node 18, and most notably there’s now an --erasableSyntaxOnly option to ensure no TypeScript-only runtime semantics can be used (ideal if you’re using Node’s type stripping features to run TypeScript code directly).

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

const config = {
port: 0,
timeout: null,
retries: '',
cache: false,
debug: undefined
};

const port = config.port ?? 3000;
const timeout = config.timeout ?? 5000;
const retries = config.retries ?? 3;
const cache = config.cache ?? true;
const debug = config.debug ?? false;

console.log([port, timeout, retries, cache, debug]);
πŸ‘10
πŸ”₯16πŸ‘12πŸ€”10❀1
πŸ‘ Electron App Boilerplate with Modern Dependencies

A basic template app that uses React 19, Tailwind CSS 4, shadcn/ui, Electron Vite, Biome, and includes a GitHub Actions release workflow.

Dalton Menezes
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘7❀2πŸ”₯2
CHALLENGE

const team = {
captain: { name: 'Jack', age: 35 },
players: ['Bob', 'Alice', 'Mike'],
details: { founded: 2020, league: 'Premier' }
};

const {
captain: { name },
players: [, second],
details: { league: division = 'Amateur' }
} = team;

console.log(`${name}-${second}-${division}`);
🀣11πŸ‘5❀4
πŸ‘15❀3πŸ”₯2πŸ€”2
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣19πŸ‘4❀3πŸ€”2πŸ”₯1
CHALLENGE

const handler = {
get: (target, prop) => {
if (prop in target) {
return target[prop] * 2;
}
return 100;
}
};

const nums = new Proxy({ a: 5, b: 10 }, handler);
console.log(nums.a, nums.b, nums.c);
πŸ”₯12
πŸ”₯7πŸ‘3❀2
✌️ JavaScript Fatigue Strikes Back

A developer with β€˜a decade away’ from writing JavaScript returns to find that one thing hasn’t changed: β€œChoosing the right JavaScript framework is hard, man.”

Allen Pike
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘9🀩3πŸ”₯2🀣1
CHALLENGE

async function fetchData() {
const promise = new Promise(resolve => {
setTimeout(() => resolve('first'), 2000);
});

console.log('start');
const result = await promise;
console.log(result);
console.log('end');
}

fetchData();
const x = 'after';
console.log(x);
❀4πŸ‘2
❀4πŸ”₯4πŸ‘2
πŸ€” TanStack Form v1.0: Headless, Type-Safe Form State Management

A type-safe, framework agnostic (React, Vue, Angular, Solid and Lit are all supported out of the box), headless and isomorphic way to create and work with forms, with this v1.0 release over two years in the making. If you already use things like Formik or React Hook Form and are wondering how it differs, here’s a comparison table.

Tanner Linsley
Please open Telegram to view this post
VIEW IN TELEGRAM
❀3πŸ”₯3πŸ‘2
CHALLENGE

function* counter() {
let count = 1;
while (true) {
const reset = yield count;
count = reset ? 1 : count + 1;
}
}

const gen = counter();
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next(true).value);
console.log(gen.next().value);
πŸ‘8πŸ”₯4❀1