β€2π2π₯1
Generate customized interactive heatmaps (think GitHub contributions graph), or render heatmaps as lines and bar charts. The site is packed with demos to enjoy. GitHub repo.
William Troup
Please open Telegram to view this post
VIEW IN TELEGRAM
β€9π₯8π5
CHALLENGE
const target = { name: "Sarah", age: 25 };
const handler = {
get(obj, prop) {
if (prop === 'greeting') {
return `Hello, I'm ${obj.name}`;
}
return obj[prop]?.toString().toUpperCase() || 'UNKNOWN';
},
set(obj, prop, value) {
if (typeof value === 'string') {
obj[prop] = value.toLowerCase();
} else {
obj[prop] = value * 2;
}
return true;
}
};
const proxy = new Proxy(target, handler);
console.log(proxy.name);
proxy.city = "Boston";
proxy.score = 15;
console.log(proxy.greeting);
console.log(proxy.city + " " + proxy.score);π16β€6π₯4
What is the output?
Anonymous Quiz
30%
SARAH Hello, I'm Sarah boston 30
32%
sarah Hello, I'm Sarah boston 15
18%
SARAH Hello, I'm sarah boston 30
20%
SARAH Hello, I'm Sarah BOSTON 30
β€5π1
Please open Telegram to view this post
VIEW IN TELEGRAM
π7β€5π₯4
CHALLENGE
class DataProcessor {
static #cache = new Map();
static #initialized = false;
static {
console.log('First block');
this.#cache.set('default', 'value1');
}
static {
console.log('Second block');
this.#cache.set('config', 'value2');
this.#initialized = true;
}
static getStatus() {
return `${this.#cache.size}-${this.#initialized}`;
}
}
console.log(DataProcessor.getStatus());π4β€3
What is the output?
Anonymous Quiz
25%
Second block First block 2-true
28%
First block Second block 2-false
16%
2-true First block Second block
31%
First block Second block 2-true
π3β€1
LibPDF bills itself as βthe PDF library TypeScript deservesβ and supports parsing, modifying, signing and generating PDFs with a modern API in Node, Bun, and the browser. GitHub repo.
Documenso
Please open Telegram to view this post
VIEW IN TELEGRAM
π10β€9π₯4
CHALLENGE
const obj1 = { a: 1, b: { c: 2 } };
const obj2 = { ...obj1 };
const obj3 = obj1;
obj2.a = 10;
obj2.b.c = 20;
obj3.b.c = 30;
console.log(obj1.a);
console.log(obj1.b.c);
console.log(obj2.a);
console.log(obj2.b.c);
console.log(obj3.a);
console.log(obj3.b.c);β€5π1π₯1
What is the output?
Anonymous Quiz
37%
1 30 10 30 1 30
26%
1 20 10 20 1 20
24%
1 2 10 20 1 2
13%
10 20 10 20 10 20
β€5π₯3π1
The results of the popular annual JavaScript survey are out, and weβre focusing on the most relevant bit to Node.js: backend frameworks. Express still leads the way, but NestJS continues to grow rapidly. Meanwhile, Hono comes top in developer satisfaction.
Devographics
Please open Telegram to view this post
VIEW IN TELEGRAM
β€5π4π₯3
CHALLENGE
function memoize(fn) {
const cache = new Map();
return function(...args) {
const key = JSON.stringify(args);
if (cache.has(key)) {
return cache.get(key);
}
const result = fn.apply(this, args);
cache.set(key, result);
return result;
};
}
const fibonacci = memoize(function(n) {
if (n <= 1) return n;
return fibonacci(n - 1) + fibonacci(n - 2);
});
console.log(fibonacci(10));
console.log(fibonacci.cache?.size || 'undefined');π₯5π3β€1
β€2π2π₯2
Have you ever wondered how systems are designed to ensure reliable event delivery and processing? How can we minimise event loss to a very low level: or even achieve near-zero message loss and highly reliable processing?
nairihar
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯9β€6π3
CHALLENGE
console.log('1');
setTimeout(() => console.log('2'), 0);
Promise.resolve().then(() => console.log('3'));
console.log('4');
Promise.resolve().then(() => {
console.log('5');
setTimeout(() => console.log('6'), 0);
});
console.log('7');β€1π1π₯1
What is the output?
Anonymous Quiz
17%
1 4 7 5 3 6 2
28%
1 7 4 3 5 2 6
37%
1 4 7 3 5 2 6
18%
1 4 7 2 3 5 6
β€12π€£3
TypeScript 6.0 is now in beta. It's a "clean up your tsconfig" release, not meant to wow but to make sense as a bridge to the eventual Go-powered 'native' TypeScript 7 compiler.
Please open Telegram to view this post
VIEW IN TELEGRAM
β€5π4π₯3
Transformers.js brings Hugging Faceβs transformer models directly to the JavaScript world, meaning you can run numerous NLP, vision, and audio models right from Node.js. v4 is WebGPU powered and is now installable with npm.
Hugging Face
Please open Telegram to view this post
VIEW IN TELEGRAM
π5π₯5β€2
CHALLENGE
const operations = {
value: 10,
multiply: function(x) {
return this.value * x;
},
arrow: (x) => {
return this.value * x;
},
nested: function() {
const inner = () => this.value * 2;
return inner();
}
};
console.log(operations.multiply(3));
console.log(operations.arrow(3));
console.log(operations.nested());π6π₯4
β€2π₯2