A look at JavaScriptβs earliest history and its prototypal nature.
JUAN DIEGO RODRΓGUEZ
Please open Telegram to view this post
VIEW IN TELEGRAM
π3β€2π₯2
const asyncFunction = async () => {
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
const result = await Promise.race([delay(100), delay(500)]);
return result;
};
asyncFunction().then(value => console.log(value));
Please open Telegram to view this post
VIEW IN TELEGRAM
β€10π2
π11π₯3β€2
Please open Telegram to view this post
VIEW IN TELEGRAM
π€£50π5π€©5β€4 1
const matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
];
let columnSums = [];
for (let i = 0; i < matrix[0].length; i++) {
let sum = 0;
for (let j = 0; j < matrix.length; j++) {
sum += matrix[j][i];
}
columnSums.push(sum);
}
console.log(columnSums);
Please open Telegram to view this post
VIEW IN TELEGRAM
π8β€6π€3π€£2
π20π€£9β€4π₯2
Building things is a great way to learn, even if you donβt end up using what you built. Even better is when someone whoβs already built something successful introduces you to the process. Nolan doesnβt go super deep but far enough to whet your appetite and for you to learn a few things by taking it further.
NOLAN LAWSON
Please open Telegram to view this post
VIEW IN TELEGRAM
π₯8π3β€2
const matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
];
let flattenedMatrix = [];
for (let i = 0; i < matrix.length; i++) {
for (let j = 0; j < matrix[i].length; j++) {
flattenedMatrix.push(matrix[i][j]);
}
}
console.log(flattenedMatrix);
Please open Telegram to view this post
VIEW IN TELEGRAM
β€7π3
What is the output?
Anonymous Quiz
30%
[[1], [2], [3], [4], [5], [6], [7], [8], [9]]
19%
[1, 4, 7, 2, 5, 8, 3, 6, 9]
20%
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
31%
[1, 2, 3, 4, 5, 6, 7, 8, 9]
π₯14β€7π3
An online tool that checks a bunch of different package registries (npm, GitHub, GitLab, PyPI, Maven, RubyGems, Go packages, Rust crate, etc.) to see if the name is used by another project.
TODD COOKE
Please open Telegram to view this post
VIEW IN TELEGRAM
π12β€3π₯1
const data = [1, 2, 3, 4, 5];
const result = data.flatMap(num => [num * 2, num * 3]);
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
β€4π1
What is the output?
Anonymous Quiz
19%
[2, 4, 6, 8, 10]
71%
[2, 3, 4, 6, 6, 9, 8, 12, 10, 15]
5%
[2, 3, 4, 6, 6, 9]
5%
[1, 2, 3, 4, 5]
π₯15β€6π6
A deep dive into how the V8 JavaScript engine (as used in Node) is getting faster thanks to work on its Maglev JIT compiler which sits in between the existing Sparkplug and TurboFan compilers (which offer distinct compilation vs execution speed tradeoffs).
THE V8 TEAM
Please open Telegram to view this post
VIEW IN TELEGRAM
π8β€5π₯1
const words = ['apple', 'banana', 'cherry'];
const result = words.flatMap(word => word.split('').reverse());
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
π2
What is the output?
Anonymous Quiz
6%
['e', 'l', 'p', 'a', 'n', 'a', 'b', 'h', 'c']
5%
['e', 'l', 'p', 'a', 'n', 'a', 'b', 'h', 'c']
43%
['elppa', 'ananab', 'yrrehc']
46%
['e', 'l', 'p', 'p', 'a', 'e', 'n', 'a', 'n', 'a', 'b', 'h', 'c', 'e', 'r', 'r', 'y']
π18π€©6π€5π€£4β€3
If you want to control a headless Chrome browser from Node, Puppeteer is for you. Now we just need a Playwright one as well ;-)
MOHAN GANESAN
Please open Telegram to view this post
VIEW IN TELEGRAM
π11π₯3β€1
const items = [1, 2, 3, 4, 5];
const result = items.reduce((acc, val) => acc.concat(Array.from({ length: val }, () => val)), []);
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
β€6π4π€©3
What is the output?
Anonymous Quiz
15%
[1, 1, 2, 2, 3, 3, 4, 4, 5, 5]
29%
[1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]
21%
[1, 2, 3, 4, 5]
35%
[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]
π14π₯6π€©2π€1
1. You are reading dozens of the best Node.js articles - this repository is a summary and curation of the top-ranked content on Node.js best practices, as well as content written here by collaborators
2. It is the largest compilation
3. Best practices have additional info
YONI GOLDBERG ET AL.
Please open Telegram to view this post
VIEW IN TELEGRAM
π11β€3π€©2π₯1
const words = ['apple', 'banana', 'cherry'];
const result = words.map(word => word.split('').sort().join(''));
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
π8β€3