What is the output?
Anonymous Quiz
21%
true true false false 0
47%
true true false false undefined
25%
true true true false undefined
6%
true true false true undefined
๐11โค2๐ฅ2
Render Mermaid diagram markup to SVG or ASCII/Unicode outputs (above) from JavaScript.
Please open Telegram to view this post
VIEW IN TELEGRAM
๐ฅ9โค7๐2
CHALLENGE
const inventory = {
apples: 5,
bananas: 0,
cherries: 12,
dates: undefined,
elderberries: null,
};
const summary = Object.entries(inventory)
.filter(([_, value]) => value)
.reduce((acc, [key, value]) => {
acc[key] = value * 2;
return acc;
}, {});
console.log(Object.keys(summary).length);
console.log(Object.values(summary).every(v => v > 10));
console.log(Object.keys(inventory).length === Object.keys(summary).length);
๐ฅ3โค1๐1
What is the output?
Anonymous Quiz
24%
3 true false
41%
2 false false
21%
2 true false
14%
3 false false
โค5๐1๐คฉ1
Please open Telegram to view this post
VIEW IN TELEGRAM
๐9๐ฅ6โค2
CHALLENGE
const user = {
profile: {
getName: () => "Marcus",
getAge: () => 30,
},
settings: null,
};
const name = user.profile?.getName?.();
const age = user.profile?.getAge?.();
const theme = user.settings?.getTheme?.() ?? "dark";
const lang = user.address?.getLocale?.() ?? "en-US";
console.log(`${name} | ${age} | ${theme} | ${lang}`);
โค6๐3
What is the output?
Anonymous Quiz
21%
Marcus | 30 | undefined | en-US
29%
Marcus | 30 | null | en-US
42%
Marcus | 30 | dark | en-US
8%
undefined | undefined | dark | en-US
โค3๐3๐ฅ2
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