What is the output?
Anonymous Quiz
20%
TypeError: Cannot read property 'value' of undefined
46%
42
30%
undefined
4%
null
A full-featured PDF viewer for React, Solid, Svelte and vanilla JS apps. Built on top of PDF.js, it offers a wide array of features from simple PDF viewing to working with multiple and large documents with annotations. Demo. v3.0 bumps up to PDF.js v5 with ICC profile support, better JPEG 2000 support, and improved rendering of large pages.
Vancho Stojkov
Please open Telegram to view this post
VIEW IN TELEGRAM
CHALLENGE
const target = { name: 'Alice' };
const handler = {
get(obj, prop) {
return prop in obj ? obj[prop].toUpperCase() : 'NOT_FOUND';
},
set(obj, prop, value) {
if (typeof value !== 'string') {
return false;
}
obj[prop] = value.trim();
return true;
}
};
const proxy = new Proxy(target, handler);
proxy.name = ' Bob ';
proxy.age = 30;
console.log(`${proxy.name}-${proxy.age}-${proxy.job}`);
What is the output?
Anonymous Quiz
17%
BOB -30-NOT_FOUND
32%
Bob-30-undefined
36%
BOB-NOT_FOUND-NOT_FOUND
15%
BOB-30-NOT_FOUND
Please open Telegram to view this post
VIEW IN TELEGRAM
CHALLENGE
const inventory = {
items: ['apple', 'banana', 'orange'],
[Symbol.iterator]: function() {
let index = 0;
const items = this.items;
return {
next: function() {
return index < items.length ?
{ value: items[index++].toUpperCase(), done: false } :
{ done: true };
}
};
}
};
const result = [...inventory].join(' + ');
console.log(result);
What is the output?
Anonymous Quiz
18%
apple,banana,orange
23%
apple + banana + orange
53%
APPLE + BANANA + ORANGE
6%
[object Object]
CHALLENGE
const obj = {};
const sym1 = Symbol('description');
const sym2 = Symbol('description');
obj[sym1] = 'Value 1';
obj[sym2] = 'Value 2';
obj.regularProp = 'Regular';
const allKeys = Object.getOwnPropertySymbols(obj).length + Object.keys(obj).length;
const comparison = sym1 === sym2;
console.log(allKeys + ',' + comparison);
CHALLENGE
const team = {
members: ['Alice', 'Bob', 'Charlie'],
leader: 'Diana',
[Symbol.iterator]: function*() {
yield this.leader;
for(const member of this.members) {
yield member;
}
}
};
let names = [];
for (const person of team) {
names.push(person);
}
console.log(names.join(', '));
What is the output?
Anonymous Quiz
27%
Alice, Bob, Charlie, Diana
43%
Diana, Alice, Bob, Charlie
20%
Diana, Alice, Bob, Charlie, undefined
10%
Alice, Bob, Charlie
CHALLENGE
function processData(data) {
try {
if (!data) {
throw new TypeError('Data is required');
}
if (data.status === 'error') {
throw new Error('Invalid status');
}
return data.value.toUpperCase();
} catch (err) {
if (err instanceof TypeError) {
return 'Type Error';
}
return err.message;
}
}
console.log(processData({ status: 'error', value: 'test' }));
What is the output?
Anonymous Quiz
19%
Type Error
50%
Invalid status
21%
TYPE ERROR
11%
TypeError: Cannot read property 'toUpperCase' of undefined
A full-featured, configurable load generation tool that uses the Sobek Go-powered JavaScript engine to support writing test scripts in JavaScript. v1.0 promises stability, first-class TypeScript support, and better extensibility.
Grafana Labs
Please open Telegram to view this post
VIEW IN TELEGRAM
CHALLENGE
const obj = {
name: 'Original',
greet() {
return function() {
console.log(`Hello, ${this.name}`);
};
},
arrowGreet() {
return () => {
console.log(`Hello, ${this.name}`);
};
}
};
const globalThis = { name: 'Global' };
const newObj = { name: 'New' };
const regularFn = obj.greet();
const arrowFn = obj.arrowGreet();
regularFn.call(newObj);
What is the output?
Anonymous Quiz
29%
Hello, Original
45%
Hello, New
20%
Hello, undefined
7%
Hello, Global
If you or your users have CSV files to import, here’s a complete CSV importing workflow for the frontend that you can drop into your app. Basic docs.
HelloCSV
Please open Telegram to view this post
VIEW IN TELEGRAM
CHALLENGE
const calculator = {
value: 10,
add: function(x) {
return this.value + x;
},
multiply: function(x) {
return this.value * x;
}
};
const add5 = calculator.add;
const double = calculator.multiply.bind(calculator);
const triple = calculator.multiply.bind({value: 3});
console.log(add5(2) + double(3) + triple(4));
Node’s release lines are shifting a little lately – v18 has gone EOL and now v23 gives way to v24 as the ‘Current’ release for when you need the cutting edge features. It comes with npm 11, V8 13.6 (hello
RegExp.escape
, Float16Array
, and `Error.isError`), the URLPattern API exposed by default, plus Undici 7.Node.js Team
Please open Telegram to view this post
VIEW IN TELEGRAM