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
πŸ₯Ά upfetch: An Advanced fetch Client Builder

A TypeScript library to enhance fetch with schema validation, automatic response parsing, and type-safety, while maintaining the familiar ՝fetch՝ API.

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

function trickyFunction(a) {
a = a || 42;
let result = (function(a) {
return a * 2;
})(a);
return result;
}

console.log(trickyFunction(0));
πŸ‘8❀2
What is the output?
Anonymous Quiz
57%
84
27%
0
13%
42
3%
2
πŸ‘11🀣11❀6πŸ€”2πŸ”₯1
πŸ”΅πŸ‘©β€πŸ¦― CSS linting with @eslint/css
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯12❀3πŸ‘2
CHALLENGE

let x = 1;
function outer() {
let x = 2;
function inner() {
console.log(x);
let x = 3;
}
inner();
}
outer();
πŸ‘6❀2
πŸ€”18πŸ‘10❀5🀣2
πŸ₯Ά Developer Implements 'Doom' in TypeScript's Type System

A curious quirk of TypeScript’s type system is that it is Turing-complete which has led some developers to implement apps entirely in the type system. One such developer has spent eighteen months producing 177 terabytes of types to get 1993’s Doom running with them. Ridiculous and amazing in equal measure, he πŸ˜‰ explains the project in this widely lauded 7-minute video.

Sarah Gooding (Socket)
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘8❀5πŸ”₯4
CHALLENGE

const user = {
name: 'John',
greet() {
const getName = () => {
console.log(this.name);
};
getName();
},
farewell: function() {
function getName() {
console.log(this.name);
}
getName();
}
};

user.greet();
user.farewell();
πŸ‘2
πŸ€”16πŸ‘15🀣5❀4πŸ”₯4
🟠 Svelvet 11: Build Node-Based UIs with Svelte

A mature Svelte component library for creating interactive node-based UIs and diagrams. v11 adds the ability to toggle between β€˜snap grid’ and freeform modes for manipulating elements. (There’s a live demo at the bottom of the homepage.)

Open Source Labs
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘4πŸ”₯2❀1
CHALLENGE

const arr = [1, 2, 3, 4, 5];
const result = arr
.map(x => x * 2)
.filter(x => x > 5)
.reduce((acc, val) => {
return acc + (val % 3 === 0 ? val : 0);
}, 0);

console.log(result);
πŸ‘12
What is the output?
Anonymous Quiz
13%
9
63%
6
15%
12
9%
18
πŸ‘16❀7πŸ€”6
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