What is the output?
Anonymous Quiz
24%
SyntaxError number 2 {"b":null,"c":0}
47%
TypeError string 2 {"a":undefined,"b":null,"c":0}
23%
SyntaxError number 2 {"a":null,"b":null,"c":0}
6%
ReferenceError number 2 {"b":null,"c":0}
π€£8β€3π2
π―π΅ Fancy writing JavaScript in Japanese (above)? Say γγγ«γ‘γ― to KokoScript.
π€£8β€5π2π₯1
CHALLENGE
const user = { name: 'Sarah', age: 28 };
const greeting = 'Hello';
const template = `${greeting}, ${user.name}! You are ${user.age} years old.`;
function createMessage(strings, ...values) {
return strings.reduce((result, string, i) => {
return result + string + (values[i] ? `[${values[i]}]` : '');
}, '');
}
const tagged = createMessage`Welcome ${user.name}, age: ${user.age}!`;
console.log(template);
console.log(tagged);β€4π₯1
What is the output?
Anonymous Quiz
42%
Hello, Sarah! You are 28 years old. Welcome Sarah, age: 28!
28%
Hello, Sarah! You are 28 years old. Welcome [Sarah], age: [28]
24%
Hello, Sarah! You are 28 years old. Welcome [Sarah], age: [28]!
7%
Hello, undefined! You are undefined years old. Welcome [Sarah], age: [28]!
β€4π3
Ever wondered how devtools can magically turn mangled, minified JavaScript back into readable source while debugging? Zero magic; thatβs a source map doing its job. But how do source maps actually work under the hood?
Manoj Vivek
Please open Telegram to view this post
VIEW IN TELEGRAM
β€3π3π₯1
CHALLENGE
const wm = new WeakMap();
const obj1 = { name: 'first' };
const obj2 = { name: 'second' };
wm.set(obj1, 'value1');
wm.set(obj2, 'value2');
const keys = [];
for (let key of wm) {
keys.push(key);
}
console.log(keys.length);
console.log(wm.has(obj1));
console.log(wm.get(obj2));
What is the output?
Anonymous Quiz
22%
TypeError: wm is not iterable
58%
2 true value2
13%
undefined false undefined
8%
0 true value2
π€£4β€2π1
CascadiaJS took place a month ago and the talk videos have been gradually rolling out onto YouTube. You can learn more about TanStack with Jack Herrington, the origin story of JavaScript with Annie Sexton, the Web Monetization API with Ioana Chiorean, and more.
CascadiaJS
Please open Telegram to view this post
VIEW IN TELEGRAM
π3β€1π₯1
CHALLENGE
const target = { name: 'Sarah', age: 25 };
const handler = {
get(obj, prop) {
if (prop === 'info') {
return `${obj.name} is ${obj.age}`;
}
return Reflect.get(obj, prop);
},
has(obj, prop) {
return prop !== 'age' && Reflect.has(obj, prop);
}
};
const proxy = new Proxy(target, handler);
console.log(proxy.info);
console.log('age' in proxy);
console.log('name' in proxy);What is the output?
Anonymous Quiz
31%
Sarah is 25, true, false
44%
Sarah is 25, false, true
18%
undefined, false, true
7%
Sarah is 25, false, false
β€3π€2π1
Originally built by JP Morgan, this data visualization component, built in C++ and compiled to WebAssembly, is well-suited for large and real-time streaming datasets. The demo on the homepage lets you try visualization types at up to 1000 changes per second. v4.0 sees the project move to the OpenJS Foundation.
OpenJS Foundation
Please open Telegram to view this post
VIEW IN TELEGRAM
β€1π1
CHALLENGE
console.log('1');
setTimeout(() => console.log('2'), 0);
Promise.resolve().then(() => console.log('3'));
queueMicrotask(() => console.log('4'));
setTimeout(() => {
console.log('5');
Promise.resolve().then(() => console.log('6'));
}, 0);
console.log('7');What is the output?
Anonymous Quiz
35%
1 7 3 4 2 5 6
30%
1 7 3 4 5 2 6
23%
1 7 2 3 4 5 6
12%
1 3 4 7 2 5 6
β€5π1π₯1
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯5