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
πŸ‘©β€πŸ’» Worlds smallest Docker Image - aka WSDI | 92 bytes

If you ever wondered what is the minimal Docker image in the world, then you are in right place. Is it debian, is it alpine or busybox ? ...

dooqod
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣9πŸ‘5❀3
❓ CHALLENGE




function asyncOperation() {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve('Async operation completed!');
}, 2000);
});
}

const asyncOperationWithTimeout = Promise.race([asyncOperation(), new Promise((_, reject) => setTimeout(() => reject('Timeout!'), 1000))]);

asyncOperationWithTimeout
.then(result => console.log(result))
.catch(error => console.log(error));
Please open Telegram to view this post
VIEW IN TELEGRAM
❀10πŸ‘4
14πŸ‘7❀2πŸ€”2
πŸ˜‚
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣788❀6πŸ‘5🀩1
❓ CHALLENGE




function fetchData() {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve('Data fetched successfully!');
}, 1000);
});
}

async function getResult() {
const result = await fetchData();
console.log(result);
}

getResult();
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘52
πŸ‘15❀6🀩4πŸ€”1
πŸ‘©β€πŸ’» Essential JavaScript Design Patterns

There are numerous programming design patterns that you’ve likely used, but you’re not aware of them...

NAIRIHAR
Please open Telegram to view this post
VIEW IN TELEGRAM
7❀5πŸ‘3
❓ CHALLENGE




const data = [
{ id: 1, name: 'Alice', skills: ['JavaScript', 'HTML'] },
{ id: 2, name: 'Bob', skills: ['JavaScript', 'CSS'] },
{ id: 3, name: 'Charlie', skills: ['HTML', 'CSS'] },
];

const result = data.reduce((acc, person) => {
person.skills.forEach(skill => {
acc[skill] = acc[skill] ? acc[skill] + 1 : 1;
});
return acc;
}, {});

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘23
πŸ‘©β€πŸ’» qnm: A CLI Tool to Look Into node_modules

If you’ve ever gone into node_modules and been overwhelmed, this tool, supporting both npm and Yarn, lets you dig around with some guidance as to what is what. You can use fuzzy search to find specific things and also see which modules are using the most space.

RAN YITZHAKI
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘5🀩3❀21
❓ CHALLENGE



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

const result = data.reduce((acc, val) => acc.concat(Array.from({ length: val }, (_, index) => val + index)), []);

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘62❀1πŸ€”1
πŸ”₯ Why I don’t burnout and still love programming

You’re facing a 10-day deadline, and you end up procrastinating for the first 8 days because you just didn’t have the mood to work. However, you managed to complete the task ...

"My Story of Beating Burnout and Loving Programming"

Nairi
❀11πŸ‘73
❓ CHALLENGE



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

const result = data.flatMap(num => Array(num).fill(num * 2));

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘4
Check out our awesome emoji pack ⭐️

✌️

πŸ–πŸ”΅

πŸ€ŸπŸŒ²πŸŒŸπŸ’»

πŸŒ²πŸ‘πŸ‘πŸŸ πŸ”΅

πŸŒ•πŸŒ•πŸπŸŒ₯πŸŒ΄πŸ¦”

πŸŽ’πŸ‘“πŸŒ‚πŸ‘™πŸ“–πŸ“ŽπŸ“˜

…

⚑️ Boost us in Telegram.
Please open Telegram to view this post
VIEW IN TELEGRAM
52πŸ‘12🀩8❀5
❓ CHALLENGE



const data = [
{ id: 1, name: 'Alice', age: 25, gender: 'Female' },
{ id: 2, name: 'Bob', age: 30, gender: 'Male' },
{ id: 3, name: 'Charlie', age: 22, gender: 'Male' },
{ id: 4, name: 'David', age: 35, gender: 'Male' },
];

const result = data.filter(person => person.gender === 'Male').map(person => person.age).reduce((acc, age) => acc + age, 0);

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘8❀42
What is the output?
Anonymous Quiz
12%
67
19%
30
62%
87
7%
57
πŸ‘2217❀4🀣4
πŸ‘©β€πŸ’» Table of Contents: Build your own X

This repository is a compilation of well-written, step-by-step guides for re-creating our favorite technologies from scratch.

codecrafters-io
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘12❀43
❓ CHALLENGE




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

const result = numbers.reduce((acc, num) => {
if (num % 2 === 0) {
acc.even += num;
} else {
acc.odd *= num;
}
return acc;
}, { even: 0, odd: 1 });

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘11❀1