Telegram Web
CHALLENGE

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

console.log(trickyFunction(0));
What is the output?
Anonymous Quiz
58%
84
28%
0
12%
42
3%
2
Please open Telegram to view this post
VIEW IN TELEGRAM
CHALLENGE

let x = 1;
function outer() {
let x = 2;
function inner() {
console.log(x);
let x = 3;
}
inner();
}
outer();
🥶 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
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();
🟠 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
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);
What is the output?
Anonymous Quiz
13%
9
65%
6
15%
12
8%
18
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
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);
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
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);
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');
🥶 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
2025/03/07 05:07:30

❌Photos not found?❌Click here to update cache.


Back to Top
HTML Embed Code: