CHALLENGE
const compose = (...fns) => (x) => fns.reduceRight((acc, fn) => fn(acc), x);
const pipe = (...fns) => (x) => fns.reduce((acc, fn) => fn(acc), x);
const double = (x) => x * 2;
const addTen = (x) => x + 10;
const square = (x) => x * x;
const negate = (x) => -x;
const transform1 = compose(negate, square, addTen, double);
const transform2 = pipe(double, addTen, square, negate);
const input = 3;
console.log(transform1(input));
console.log(transform2(input));
console.log(transform1(input) === transform2(input));
๐6โค3๐ฅ1
What is the output?
Anonymous Quiz
17%
-256 -256 false
55%
-256 -256 true
20%
-256 -36 false
8%
-36 -256 false
โค4๐2
A big step forward for a project thatโs almost 15 years old, and one of few stable, trusty options for rendering ultra-high resolution images for users to zoom into and pan around. Version 6 introduces a new async and cache-managed pipeline, making it far more efficient at scale.
OpenSeadragon Contributors
Please open Telegram to view this post
VIEW IN TELEGRAM
๐ฅ5โค4๐3๐คฉ1
CHALLENGE
class Session {
#id;
constructor(id) {
this.#id = id;
}
getId() { return this.#id; }
}
const activeSessions = new WeakSet();
const s1 = new Session("user_42");
const s2 = new Session("user_99");
let s3 = new Session("user_07");
activeSessions.add(s1);
activeSessions.add(s2);
activeSessions.add(s3);
console.log(activeSessions.has(s1)); // line A
console.log(activeSessions.has(s3)); // line B
s3 = null;
console.log(activeSessions.has(s3)); // line C
activeSessions.delete(s2);
console.log(activeSessions.has(s2)); // line D
console.log(activeSessions.size); // line E
โค7๐2๐ฅ1
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