Set a size or load-time budget for your code and this tool can fail CI (or flag a PR) if a change goes over it. You can also do one-off checks and see visualizations of where the bytes are. Framework-agnostic and doesnβt care which bundler or CI you use.
Andrey Sitnik
Please open Telegram to view this post
VIEW IN TELEGRAM
β€2
CHALLENGE
class Base {
static log = [];
static {
Base.log.push('base-block');
}
static value = (() => { Base.log.push('base-field'); return 1; })();
}
class Derived extends Base {
static {
Derived.log.push('derived-block');
}
static value2 = (() => { Derived.log.push('derived-field'); return 2; })();
}
console.log(Derived.log.join(','));β€1
Please open Telegram to view this post
VIEW IN TELEGRAM
β€8
CHALLENGE
async function* gen() {
const x = yield 1;
const y = yield x + 1;
return x + y;
}
async function main() {
const it = gen();
const a = await it.next();
const b = await it.next(10);
const c = await it.next(20);
console.log(`${a.value} ${b.value} ${c.value} ${c.done}`);
}
main();π2
What is the output?
Anonymous Quiz
26%
1 11 30 true
33%
1 11 31 true
32%
undefined 11 30 true
8%
1 10 30 true
CHALLENGE
const sym1 = Symbol('id');
const sym2 = Symbol('id');
const obj = {
[sym1]: 'first',
[sym2]: 'second',
regular: 'value'
};
const s = Symbol.for('shared');
const s2 = Symbol.for('shared');
console.log(
sym1 === sym2,
Object.keys(obj).length,
Reflect.ownKeys(obj).length,
s === s2,
sym1.toString()
);What is the output?
Anonymous Quiz
27%
false 1 3 false Symbol(id)
46%
true 1 3 true Symbol(id)
20%
false 1 3 true Symbol(id)
7%
false 3 3 true Symbol(id)
π₯3β€1π1
CHALLENGE
function tag(strings, ...values) {
return strings.raw.join('|') + '::' + values.join(',');
}
const a = 5, b = 10;
console.log(tag`Sum:\n${a + b} End`);What is the output?
Anonymous Quiz
34%
Sum:\n| End::5,10
33%
Sum:\n End::15
27%
Sum:\n| End::15
6%
Sum: End::15