A popular webapp framework that includes auth, ORM, queues, testing, etc. in a cohesive fashion. With v7 comes an all new web site, modernizations, OpenTelemetry integration, new starter kits to rapidly build new apps, barrel file generation, and end-to-end type safety.
Harminder Virk
Please open Telegram to view this post
VIEW IN TELEGRAM
๐8๐ฅ4โค1
CHALLENGE
let x = 'global';
function testScope() {
console.log(x);
if (true) {
let x = 'block';
var y = 'function';
console.log(x);
}
console.log(x);
console.log(y);
}
testScope();
๐ฅ6๐2โค1
What is the output?
Anonymous Quiz
40%
global block global function
33%
global block block function
20%
global block global undefined
8%
undefined block global function
๐6โค4๐ฅ1
NumPy is a fundamental piece of the Python scientific computing ecosystem and well-entrenched in many use cases. JavaScript has some options in this regard (e.g. TensorFlow.js), but numpy-ts is an attempt to replace the NumPy experience as closely as possible (currently at 94% API coverage). Thereโs an online playground if you want to give it a quick spin.
Nicolas Dupont
Please open Telegram to view this post
VIEW IN TELEGRAM
โค12๐ฅ5๐3
The 3-Second Production Mystery That Took Me 20 Days to Solve
This is a story about how we found a 3s EventLoop lag (p99) in one of our microservices while exploring the Kafka consumer lagโฆ and how I tracked it down and fixed.
Itโs Feb 6. I notice an increase in Kafka lag in our Grafana chart...
nairihar
Please open Telegram to view this post
VIEW IN TELEGRAM
โค5๐5๐ฅ4
CHALLENGE
const name = "Zara";
const age = 28;
const role = "engineer";
const user = { name, age, role };
const { name: fullName, age: years, role: position = "developer" } = user;
const greet = ({ name, age }) => `${name} is ${age}`;
const team = [
{ name: "Zara", age: 28 },
{ name: "Leo", age: 34 },
];
const [{ name: first }, { age: secondAge }] = team;
console.log(`${fullName}, ${years}, ${position} | ${first}, ${secondAge}`);
โค6๐4๐ฅ2
What is the output?
Anonymous Quiz
30%
Zara, 28, engineer | Zara, 34
27%
Zara, 28, engineer | Leo, 34
34%
Zara, 28, developer | Zara, 34
10%
Zara, 28, developer | Leo, 28
๐7โค2
Please open Telegram to view this post
VIEW IN TELEGRAM
โค6๐ฅ6๐1
CHALLENGE
const a = 10n ** 3n;
const b = BigInt(Number.MAX_SAFE_INTEGER) + 1n;
const c = b - BigInt(Number.MAX_SAFE_INTEGER);
const results = {
power: a,
safe: c,
type: typeof a,
equal: 10n == 10,
strict: 10n === 10,
};
console.log(
results.power,
results.safe,
results.type,
results.equal,
results.strict
);
โค3๐2๐ฅ1
What is the output?
Anonymous Quiz
12%
1000n 0n bigint true true
39%
1000n 1n number true false
40%
1000n 1n bigint true false
9%
1000 1 bigint false false
๐4โค2๐ฅ2
Bunโs REPL has been completely rewritten with many improvements (both practical and cosmetic), there's a
--compile --target=browser option for building self-contained HTML files with all JS, CSS, and assets included (ideal for simple JS-powered single page apps), full support for TC39 stage 3 ES decorators, a faster event loop, barrel import optimization, and more.Jarred Sumner
Please open Telegram to view this post
VIEW IN TELEGRAM
๐4๐ฅ4โค3๐คฉ1
CHALLENGE
class Registry {
static #cache = new Map();
static #instanceCount = 0;
static defaultTTL;
static {
Registry.#cache.set("base", { value: 42, active: true });
Registry.#instanceCount = 1;
Registry.defaultTTL = 3600;
console.log("Static block 1:", Registry.#instanceCount, Registry.defaultTTL);
}
static {
const base = Registry.#cache.get("base");
Registry.#cache.set("derived", { value: base.value * 2, active: false });
Registry.#instanceCount++;
console.log("Static block 2:", Registry.#instanceCount, Registry.#cache.size);
}
static getSnapshot() {
return [...Registry.#cache.entries()]
.map(([k, v]) => `${k}:${v.value}`)
.join(", ");
}
}
console.log("Snapshot:", Registry.getSnapshot());
console.log("TTL:", Registry.defaultTTL);โค5๐4
๐4โค1
Please open Telegram to view this post
VIEW IN TELEGRAM
๐คฃ24โค3๐3๐ฅ3
CHALLENGE
const engine = {
type: "V8",
displacement: 4.0,
getInfo() {
return `${this.type} - ${this.displacement}L`;
},
turbo: {
boost: 12,
getBoost() {
return `${this.type ?? "Unknown"} boosted at ${this.boost} psi`;
},
},
};
const detached = engine.getInfo;
const turboInfo = engine.turbo.getBoost;
console.log(engine.getInfo());
console.log(engine.turbo.getBoost());
console.log(turboInfo());๐ฅ5โค4
What is the output?
Anonymous Quiz
21%
V8 - 4L Unknown boosted at 12 psi Unknown boosted at undefined psi
26%
V8 - 4.0L Unknown boosted at 12 psi V8 boosted at 12 psi
33%
V8 - 4.0L V8 boosted at 12 psi Undefined boosted at 12 psi
20%
V8 - 4.0L Unknown boosted at 12 psi Unknown boosted at undefined psi
๐3โค1
CHALLENGE
const product = {
name: "Laptop",
price: 1299,
stock: 42,
discount: 0,
category: "Electronics",
};
const filtered = Object.entries(product)
.filter(([key, value]) => Boolean(value))
.reduce((acc, [key, value]) => {
acc[key] = value;
return acc;
}, {});
console.log(Object.keys(filtered).length);
console.log(Object.values(filtered).includes(0));
console.log(Object.keys(filtered).join(", "));๐4๐ฅ1
What is the output?
Anonymous Quiz
27%
5 true name, price, stock, discount, category
27%
4 true name, price, stock, category
16%
3 false name, price, category
30%
4 false name, price, stock, category
โค6๐คฃ1
CHALLENGE
const transactions = [
{ id: 1, type: "credit", amount: 200 },
{ id: 2, type: "debit", amount: 50 },
{ id: 3, type: "credit", amount: 150 },
{ id: 4, type: "debit", amount: 30 },
{ id: 5, type: "credit", amount: 100 },
];
const result = transactions
.filter(tx => tx.type === "credit")
.map(tx => ({ ...tx, amount: tx.amount * 1.1 }))
.reduce((acc, tx) => acc + tx.amount, 0);
console.log(result.toFixed(2));
๐ฅ3
โค4๐ฅ1๐ค1