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
This media is not supported in your browser
VIEW IN TELEGRAM
Thank You for 30k! 🫑

We’ve just hit a major milestone: 30,000 subscribers! ⚑️

Thank you for being part of our community. Your support and engagement mean the world to us, and we’re excited to keep bringing you the content you love.

Stay tuned for more updates and great things ahead!

P.S. Play the video with the sound on.

@JavaScript Newsletter Team

✌️ Check out our emoji pack here

🀝 Collaboration
Please open Telegram to view this post
VIEW IN TELEGRAM
2πŸ‘20❀9🀩5πŸ”₯2
CHALLENGE

const items = new WeakSet();
const obj1 = { id: 1 };
const obj2 = { id: 2 };

items.add(obj1);
items.add(obj2);

obj2.value = 'test';
console.log(items.has(obj2));

obj2 = null;
setTimeout(() => {
console.log(items.has(obj2));
}, 0);
πŸ‘9
πŸ”₯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