JavaScript
32.1K subscribers
1.06K photos
10 videos
33 files
737 links
A resourceful newsletter featuring the latest and most important news, articles, books and updates in the world of #javascript 🚀 Don't miss our Quizzes!

Let's chat: @nairihar
Download Telegram
⛽️ npm in Review: A Retrospective in Numbers

From Socket comes a look at the past year from the perspective of the npm registry, focused largely on statistics (2.5 million live packages!), including download numbers, popular packages, as well as some ‘quirky facts’ like the package with the most maintainers (554, if you're wondering.)

PHILIPP BURCKHARDT (SOCKET)
Please open Telegram to view this post
VIEW IN TELEGRAM
👍651
CHALLENGE

const matrix = [
[2, 4],
[6, 8],
];

const result = matrix.reduceRight((acc, row) => acc.concat(row.map(num => num * 2)), []);

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
94👍3🤣3
👍11🤔1084🤣1
🌲 Tinybench: A Tiny, Simple Benchmarking Library

No dependencies, but uses whatever precise timing capabilities are available (e.g. process.hrtime or `peformance.now`). You can then benchmark whatever functions you want, specify how long or how many times to benchmark for, and get a variety of stats in return.

TINYLIBS
Please open Telegram to view this post
VIEW IN TELEGRAM
5👍33
CHALLENGE

async function asyncArrayOperations() {
const array1 = [1, 2, 3];
const array2 = [4, 5, 6];

const result = await Promise.all([array1, array2].map(async arr => {
return await arr.reduce(async (acc, num) => {
return (await acc) + num;
}, Promise.resolve(0));
}));

console.log(result);
}

asyncArrayOperations();
Please open Telegram to view this post
VIEW IN TELEGRAM
8👍2🔥1
75👍4
🌕 ✌️ I built my own Google (sort of...) with Text Transformers and Qdrant Vector Database

Building content search functionality for Next.js project almost always requires deep understanding of how the text similarity search works. Nowadays we have text transformer AI Models from HuggingFace and Vector Databases that easily could be integrated to Next.js giving the powerful similarity search functionality with a blasting speed! This video below explains this in detail.

Tigran Tech
Please open Telegram to view this post
VIEW IN TELEGRAM
137👍4
CHALLENGE

const matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
];

async function asyncSumOfEvenNumbers(matrix) {
const result = await matrix.flat().filter(async num => {
return await Promise.resolve(num % 2 === 0);
});

return result.reduce((acc, num) => acc + num, 0);
}

asyncSumOfEvenNumbers(matrix).then(result => console.log(result));
Please open Telegram to view this post
VIEW IN TELEGRAM
👍6
🤔3077👍4🤩3
Why JavaScript is so hard 😂
Please open Telegram to view this post
VIEW IN TELEGRAM
🤣967🤔5🤩43
CHALLENGE

async function asyncSumOfSquares() {
const numbers = [1, 2, 3, 4, 5];

const result = await numbers.reduce(async (acc, num) => {
const currentSquare = await Promise.resolve(num * num);
return (await acc) + currentSquare;
}, Promise.resolve(0));

console.log(result);
}

asyncSumOfSquares();
Please open Telegram to view this post
VIEW IN TELEGRAM
👍10🔥21
👍1483🤩1
🕺 9K Strong!

Together, we're creating a community that thrives on knowledge, support, and positive vibes. 🎉

Cheers to 9K and beyond! 🌟🙌

✌️ Check out our emoji pack here.

⚡️ Boost us in Telegram.
Please open Telegram to view this post
VIEW IN TELEGRAM
1312👍9🤩2
CHALLENGE

const array = [1, 2, 3, 4, 5];

const result = array.map(num => Promise.resolve(num * 2));

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
9👍3🔥1
Love it!🔥
Please open Telegram to view this post
VIEW IN TELEGRAM
85🤣1910🤩8👍7🤔1
CHALLENGE

async function complexAsyncFunction() {
const promise1 = new Promise(resolve => setTimeout(() => resolve(10), 1000));
const promise2 = new Promise(resolve => setTimeout(() => resolve(20), 500));

const result = await Promise.race([promise1, promise2]);

console.log(result);
}

complexAsyncFunction();
Please open Telegram to view this post
VIEW IN TELEGRAM
114👍2
14👍5🤩4
🤔 The AHA Stack: Another Way to Build Modern Webapps

The AHA Stack is a full-stack webapp approach that brings together Astro, htmx, and Alpine.js, and where you send HTML over the wire. This is a fantastic showcase site that sells the idea well, complete with explanations and examples.

FLAVIO COPES
Please open Telegram to view this post
VIEW IN TELEGRAM
👍86🤣5🤩1
CHALLENGE

const array = [
{ name: 'John', score: 80 },
{ name: 'Jane', score: 95 },
{ name: 'Doe', score: 88 },
];

const result = array.every(obj => obj.score >= 80);

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
10👍5🤔3