What is the output?
Anonymous Quiz
35%
[1, 1, 2, 1]
25%
[1, NaN, 2, 2]
32%
[1, undefined, 2, 2]
7%
[1, NaN, 1, 1]
π10β€1π₯1
While there have been numerous IRC channels and Discord and Slack servers where Node developers can congregate, the Nodeiflux Discord server has been promoted to being an official one β hereβs the invite link if youβre a Discord user. There are already 15k members, so itβs hopping.
Vitullo and Wunder
Please open Telegram to view this post
VIEW IN TELEGRAM
π€£7π5β€1π₯1
CHALLENGE
let x = 1;
function outer() {
let x = 2;
function inner() {
console.log(x);
let x = 3;
}
inner();
}
outer();
π7
What is the output?
Anonymous Quiz
36%
2
13%
1
35%
ReferenceError: Cannot access 'x' before initialization
16%
3
π13π€3π₯2β€1
Designed to work with any Node framework or ORM, Protect.js provides AES-256 based βencryption in useβ functionality. GitHub repo.
CipherStash
Please open Telegram to view this post
VIEW IN TELEGRAM
β€7π2π€£2π₯1
CHALLENGE
function createCounter() {
let count = 0;
return function() {
count++;
return count;
};
}
const counter1 = createCounter();
const counter2 = createCounter();
counter1();
counter1();
counter2();
const result = counter1() + counter2();
console.log(result);
π6π€£6π€3β€2π₯1
π€14π€£11π10π₯6β€4
CHALLENGE
function* fibonacci() {
let [prev, curr] = [0, 1];
while (true) {
yield curr;
[prev, curr] = [curr, prev + curr];
}
}
function* take(iterable, limit) {
for (const item of iterable) {
if (limit <= 0) return;
yield item;
limit--;
}
}
const fibs = [...take(fibonacci(), 5)];
fibs.push(fibs[0] + fibs[1]);
console.log(fibs);
β€3π3π€1
A one-stop, intelligent build analyzer making it easier to identify bottlenecks and optimize performance. Itβs part of the same family of tools as Rspack (a Rust-powered web bundler) but is fully webpack compatible. If youβve ever asked why your build times are too long, this is for you.
ByteDance Inc.
Please open Telegram to view this post
VIEW IN TELEGRAM
π5π₯2β€1
What is the output?
Anonymous Quiz
28%
[0, 1, 1, 2, 3, 1]
27%
[1, 2, 3, 5, 8, 2]
35%
[1, 1, 2, 3, 5, 2]
10%
[1, 2, 3, 5, 8, 3]
β€8π1π₯1
CHALLENGE
function* counter() {
let count = 1;
while (true) {
const reset = yield count++;
if (reset) {
count = 1;
}
}
}
const gen = counter();
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next(true).value);
console.log(gen.next().value);
π8π₯2π€1
What is the output?
Anonymous Quiz
13%
1, 2, 0, 1
39%
1, 2, undefined, 1
40%
1, 2, 1, 2
8%
1, 2, 1, 1
π9π€£8π€©5π₯4β€3
Youβve probably heard about people βvibe codingβ games by letting LLMs do the coding work, but what if you want to build a game yourself that has neural network powered elements? TensorFlow.js offers one solution that you could just as easily adapt to non-gaming contexts.
Manvar and Raina (Docker)
Please open Telegram to view this post
VIEW IN TELEGRAM
π10β€2π₯2
CHALLENGE
const user = {
profile: {
name: 'Alice',
social: null,
getDetails() {
return { verified: true };
}
}
};
const result = [
user?.profile?.name,
user?.profile?.social?.handle,
user.profile.getDetails?.()?.verified,
user?.nonExistent?.property
];
console.log(result);
π7
What is the output?
Anonymous Quiz
16%
['Alice', null, true, null]
45%
['Alice', undefined, true, undefined]
22%
['Alice', null, true, undefined]
17%
TypeError: Cannot read properties of null (reading 'handle')
π7π€©5
Motion is a popular and powerful animation library most commonly associated with React, but now thereβs a new Vue flavor and itβs feature complete, too.
Matt Perry (Motion)
Please open Telegram to view this post
VIEW IN TELEGRAM
π6β€5
CHALLENGE
function Vehicle(type) {
this.type = type;
}
Vehicle.prototype.getType = function() {
return this.type;
};
function Car(make) {
this.make = make;
}
Car.prototype = Object.create(Vehicle.prototype);
Car.prototype.constructor = Car;
const myCar = new Car('Tesla');
myCar.type = 'electric';
console.log(myCar.getType(), myCar instanceof Vehicle, myCar.constructor.name);
β€1
What is the output?
Anonymous Quiz
17%
undefined true Car
24%
electric false Vehicle
44%
electric true Car
14%
electric true undefined
π6β€4π€3
CHALLENGE
const target = { a: 1, b: 2 };
const handler = {
get(obj, prop) {
return prop in obj ? obj[prop] * 2 : 'Not found';
}
};
const proxy = new Proxy(target, handler);
// Add a property to the original target
target.c = 3;
// Attempt to access properties through proxy and Reflect
console.log([
proxy.a,
proxy.z,
Reflect.get(target, 'b'),
Reflect.get(proxy, 'c')
]);
π4