Four months in the making, TypeScript 5.8 lands with a strong Node focus. You can now use require() for ES modules in the nodenext module, thereβs a new node18 module for developers who want to keep targeting Node 18, and most notably thereβs now an --erasableSyntaxOnly option to ensure no TypeScript-only runtime semantics can be used (ideal if youβre using Nodeβs type stripping features to run TypeScript code directly).
Microsoft
Please open Telegram to view this post
VIEW IN TELEGRAM
π8β€4π₯1
CHALLENGE
const config = {
port: 0,
timeout: null,
retries: '',
cache: false,
debug: undefined
};
const port = config.port ?? 3000;
const timeout = config.timeout ?? 5000;
const retries = config.retries ?? 3;
const cache = config.cache ?? true;
const debug = config.debug ?? false;
console.log([port, timeout, retries, cache, debug]);
π10
What is the output?
Anonymous Quiz
18%
[3000, null, 3, false, false]
33%
[0, 5000, '', false, false]
12%
[0, 5000, '', false, true]
37%
[3000, 5000, 3, true, false]
π₯16π12π€10β€1
A basic template app that uses React 19, Tailwind CSS 4, shadcn/ui, Electron Vite, Biome, and includes a GitHub Actions release workflow.
Dalton Menezes
Please open Telegram to view this post
VIEW IN TELEGRAM
π7β€2π₯2
CHALLENGE
const team = {
captain: { name: 'Jack', age: 35 },
players: ['Bob', 'Alice', 'Mike'],
details: { founded: 2020, league: 'Premier' }
};
const {
captain: { name },
players: [, second],
details: { league: division = 'Amateur' }
} = team;
console.log(`${name}-${second}-${division}`);
π€£11π5β€4
What is the output?
Anonymous Quiz
8%
undefined-Bob-Premier
35%
Jack-undefined-Premier
22%
undefined-Alice-Amateur
34%
Jack-Alice-Premier
π15β€3π₯2π€2
CHALLENGE
const handler = {
get: (target, prop) => {
if (prop in target) {
return target[prop] * 2;
}
return 100;
}
};
const nums = new Proxy({ a: 5, b: 10 }, handler);
console.log(nums.a, nums.b, nums.c);
π₯12
What is the output?
Anonymous Quiz
25%
10 20 undefined
24%
5 10 100
19%
5 10 undefined
32%
10 20 100
π₯7π3β€2
A developer with βa decade awayβ from writing JavaScript returns to find that one thing hasnβt changed: βChoosing the right JavaScript framework is hard, man.β
Allen Pike
Please open Telegram to view this post
VIEW IN TELEGRAM
π9π€©3π₯2π€£1
CHALLENGE
async function fetchData() {
const promise = new Promise(resolve => {
setTimeout(() => resolve('first'), 2000);
});
console.log('start');
const result = await promise;
console.log(result);
console.log('end');
}
fetchData();
const x = 'after';
console.log(x);
β€4π2
What is the output?
Anonymous Quiz
33%
start after first end
22%
after start first end
27%
start first end after
18%
start end first after
β€4π₯4π2
A type-safe, framework agnostic (React, Vue, Angular, Solid and Lit are all supported out of the box), headless and isomorphic way to create and work with forms, with this v1.0 release over two years in the making. If you already use things like Formik or React Hook Form and are wondering how it differs, hereβs a comparison table.
Tanner Linsley
Please open Telegram to view this post
VIEW IN TELEGRAM
β€3π₯3π2
CHALLENGE
function* counter() {
let count = 1;
while (true) {
const reset = yield count;
count = reset ? 1 : 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π₯4β€1
What is the output?
Anonymous Quiz
34%
1, 2, 1, 2
25%
1, undefined, 1, 2
27%
1, 2, true, 3
14%
1, 2, 3, 4
π₯4β€3π1
Each year, the HTTP Archive puts together the Web Almanac, a report on the βstate of the Webβ. The JavaScript section has just gone live and goes into depth on how much JS weβre using (or failing to use!), the popularity of TypeScript, loading methods, Web Worker use, and, yes, jQuery still leads the way!
HTTP Archive
Please open Telegram to view this post
VIEW IN TELEGRAM
π5β€4π€2π₯1
CHALLENGE
const user = {
profile: {
name: "Alice",
settings: null
},
getPreferences() {
return this.profile.settings?.theme || "default";
}
};
const admin = {
profile: {
name: "Admin"
},
getPreferences() {
return this.profile.settings?.theme || "default";
}
};
console.log(user.getPreferences());
console.log(admin.getPreferences());
console.log(user.profile.extra?.id?.toString());
π7β€5
What is the output?
Anonymous Quiz
28%
default TypeError: Cannot read properties of undefined undefined
48%
default default undefined
12%
TypeError: Cannot read properties of null default undefined
12%
default default null
π€5β€1π1
Please open Telegram to view this post
VIEW IN TELEGRAM
π9β€7π₯1
CHALLENGE
function Animal(name) {
this.name = name;
}
Animal.prototype.speak = function() {
return `${this.name} makes a noise`;
};
function Dog(name) {
Animal.call(this, name);
}
Dog.prototype = Object.create(Animal.prototype);
Dog.prototype.constructor = Dog;
Dog.prototype.speak = function() {
return `${this.name} barks`;
};
const animal = new Animal('Animal');
const dog = new Dog('Rex');
console.log(dog instanceof Animal);
π₯5π1