What is the output?
Anonymous Quiz
54%
3 [1, 2, 3]
14%
5 [1, 2, 3, 4, 5]
27%
3 [1, 2, 3, 4, 5]
6%
5 [1, 2, 3]
π₯19π12π€5β€4
π JavaScript Temporal is Coming (For Real!)
We first mentioned the Temporal API proposal providing a better way to handle dates and times in JavaScript almost five years ago (in issue 496!) but now it really is almost here. Brian explains its basic concepts and where initial support is starting to appear.
Brian Smith
We first mentioned the Temporal API proposal providing a better way to handle dates and times in JavaScript almost five years ago (in issue 496!) but now it really is almost here. Brian explains its basic concepts and where initial support is starting to appear.
Brian Smith
β€8π3π₯3
CHALLENGE
const person = {
name: "Alice",
age: 30,
city: "New York"
};
const keys = Object.keys(person);
const values = Object.values(person);
const result = keys.map((key, index) => `${key}: ${values[index]}`);
console.log(result);
π9π€£5π€3
What is the output?
Anonymous Quiz
25%
["name: Alice", "city: New York", "age: 30"]
13%
["Alice: name", "30: age", "New York: city"]
11%
["Alice", 30, "New York"]
51%
["name: Alice", "age: 30", "city: New York"]
β€17π14π€6π€©1
deck.gl provides a way to create complex yet high performance data visualizations composed of multiple layers (examples). It can be used in a vanilla JS way or through React components and itβs ready for WebGPU.
OpenJS Foundation
Please open Telegram to view this post
VIEW IN TELEGRAM
π14β€6π₯2
CHALLENGE
var arr = Array.from({ length: 5 }, (v, i) => i * 2);
console.log(arr);
π2
What is the output?
Anonymous Quiz
56%
[0, 2, 4, 6, 8]
33%
[2, 4, 6, 8, 10]
5%
[1, 3, 5, 7, 9]
6%
[0, 1, 2, 3, 4]
π18β€5π₯4π€©1
What if you could shrink all npm package sizes by 5%.. wouldnβt that benefit all of us? Hereβs how one developer did just that using Zopfli compression and then made a proposal to the npm maintainers to implement it. While promising, the proposal was ultimately rejected due to a variety of challenges and trade-offs, such as slower publishing speeds. Nonetheless, itβs a good story packed with things to learn from.
Evan Hahn
Please open Telegram to view this post
VIEW IN TELEGRAM
β€9π7π₯2
CHALLENGE
function trickyCount(n) {
if (n <= 1) return n;
return trickyCount(n - 1) + trickyCount(n - 2);
}
function wrapCount(n) {
return trickyCount(n) - trickyCount(n - 4);
}
console.log(wrapCount(6));
π19π€3
π€21π8β€4π₯3
CHALLENGE
function mystery(x) {
return (function(y) {
return x + y;
})(x * 2);
}
const result1 = mystery(2);
const result2 = mystery(5);
const result3 = mystery(-1);
console.log(result1, result2, result3);
π9
π€24π7π€£7π₯3
A long-time maintainer of the wildly successful Electron cross-platform app framework stands by the technical choices Electron has made over the years and defends it against some of the more common criticisms here.
Felix Rieseberg
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯4π3β€1
CHALLENGE
function mysteriousFunction(a) {
let result = 0;
for (let i = 1; i <= a; i++) {
if (i % 3 === 0 && i % 5 === 0) {
result += i * 2;
} else if (i % 3 === 0) {
result += i;
} else if (i % 5 === 0) {
result -= i;
}
}
return result;
}
console.log(mysteriousFunction(15));
π€£19π13π€1
π€26π8π₯7β€4
CHALLENGE
function tricky() {
let a = 1;
let b = 2;
const result = (function(a) {
a = 3;
return a + b;
})(a);
return result;
}
console.log(tricky());
π3β€2
π15π€7π€£6π₯3
The irony is that while Node popularized JavaScript on the server (though Netscape was doing it in the 90s) this modern, standardized cross-runtime approach doesnβt work on Node ...yet ;-)
Marvin Hagemeister
Please open Telegram to view this post
VIEW IN TELEGRAM
β€7π4π₯4
CHALLENGE
let symbol1 = Symbol('description');
let symbol2 = Symbol('description');
const obj = {
[symbol1]: 'value1',
[symbol2]: 'value2'
};
console.log(obj[symbol1]);
console.log(symbol1 === symbol2);
π₯4π2