Please open Telegram to view this post
VIEW IN TELEGRAM
π6π₯3β€1
CHALLENGE β
function* numberGenerator() {
let i = 0;
while (i < 3) {
yield i++;
}
}
const gen = numberGenerator();
console.log(gen.next().value);
console.log(gen.return(10).value);
console.log(gen.next().value);
Please open Telegram to view this post
VIEW IN TELEGRAM
π€©4π2π₯1
π€10π5β€2
CHALLENGE β
function processData({ a = 10, b = 20 } = { a: 30 }) {
console.log(a, b);
}
processData({ a: 5 });
processData();
Please open Telegram to view this post
VIEW IN TELEGRAM
π1
π€13π7π₯2π€£1
CHALLENGE β
const obj = {};
Object.defineProperty(obj, 'name', {
value: 'Alice',
writable: false,
configurable: false
});
try {
obj.name = 'Bob';
delete obj.name;
console.log(obj.name);
} catch (e) {
console.log('Error:', e.message);
}
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯3π1
Itβs been a quiet few weeks for official releases. This update marks one of the last in Node 20βs run as the active LTS release, and introduces experimental network inspection support. Node 22 will soon take over the active LTS crown (as per schedule) but what will its codename be given there are no elements starting with J? Amazingly, this question was asked six years ago and it's (probably) going to be Jod.
MichaΓ«l Zasso
Please open Telegram to view this post
VIEW IN TELEGRAM
β€6π4π₯2
CHALLENGE β
const map = new Map();
const key1 = {};
const key2 = key1;
map.set(key1, "Value for key1");
map.set(key2, "Value for key2");
console.log(map.get({}));
console.log(map.get(key1));
Please open Telegram to view this post
VIEW IN TELEGRAM
π3β€1
What is the output?
Anonymous Quiz
36%
undefined Value for key1
27%
undefined Value for key2
24%
Value for key2 Value for key2
14%
Value for key1 Value for key2
π₯8β€4π4π€£4
Hono is a neat, lightweight framework designed to run on any JavaScript runtime that has been picking up steam in the past year. You can create a simple app reminiscent of Express.js, say, but run it on Cloudflare Workers, Deno, Bun, or Node. Itβs in heavy use all over the place, and has lots of interesting features like letting you write HTML with JSX.
Yusuke Wada
Please open Telegram to view this post
VIEW IN TELEGRAM
π4β€1π₯1
We're excited to announce that our newsletter reached 25,000 subscribers! This was one of our biggest goals for 2024, and we couldnβt have done it without your amazing support.
Thank you for being part of this journey. Weβve got more exciting content coming, so stay tuned!
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯29π8β€6π€©3
CHALLENGE β
Promise.resolve(1)
.then(value => {
console.log(value);
throw new Error('Something went wrong');
})
.then(() => {
console.log('This will not run');
})
.catch(error => {
console.log('Caught:', error.message);
return 42;
})
.then(value => {
console.log('Recovered with:', value);
});
Please open Telegram to view this post
VIEW IN TELEGRAM
π3π€2
Please open Telegram to view this post
VIEW IN TELEGRAM
π€£64π9β€4π€1π€©1
CHALLENGE β
const sym = Symbol('unique');
const obj = {
[sym]: 'Secret',
public: 'Visible'
};
console.log(Object.keys(obj));
console.log(obj[Symbol('unique')]);
Please open Telegram to view this post
VIEW IN TELEGRAM
π2
What is the output?
Anonymous Quiz
31%
[βpublicβ, Symbol(βuniqueβ)], Secret
34%
[βpublicβ, Symbol(βuniqueβ)], undefined
23%
[βpublicβ], undefined
13%
[βpublicβ], Secret
π₯8π3
npx is-my-node-vulnerable
A tool created and maintained by the Node.js security team. This utility allows you to quickly check for known vulnerabilities and helps safeguard your projects.
Please open Telegram to view this post
VIEW IN TELEGRAM
π13β€6π₯6π€©2
CHALLENGE
for (var i = 0; i < 3; i++) {
setTimeout(() => console.log(i), 100);
}
β€4π3