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
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
What is the output?
Anonymous Quiz
20%
undefined
35%
'Async operation completed!'
14%
This will result in an error
31%
'Timeout!'
Please open Telegram to view this post
VIEW IN TELEGRAM
π€£78 8β€6π5π€©1
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
π5 2
What is the output?
Anonymous Quiz
70%
"Data fetched successfully!"
15%
'Fetching data...'
10%
undefined
5%
This will result in an error
π15β€6π€©4π€1
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
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
What is the output?
Anonymous Quiz
24%
{ JavaScript: 3, HTML: 2, CSS: 2 }
20%
{ JavaScript: 3, HTML: 1, CSS: 1 }
14%
{ JavaScript: 2, HTML: 1, CSS: 1 }
42%
{ JavaScript: 2, HTML: 2, CSS: 2 }
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β€2 1
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
π6 2β€1π€1
What is the output?
Anonymous Quiz
32%
[1, 2, 2, 3, 3, 4, 5, 5, 5, 6, 7, 7, 8, 9, 9]
27%
[1, 2, 3, 4, 5, 6, 7, 8, 9]
31%
[1, 2, 3, 3, 4, 5, 4, 5, 6, 7, 5, 6, 7, 8, 9]
11%
[1, 2, 2, 3, 3, 4, 5, 5, 6, 7, 8, 9]
π15π€8β€4
π₯ 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
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π7 3
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
What is the output?
Anonymous Quiz
20%
[1, 1, 2, 2, 3, 3, 4, 4, 5, 5]
10%
[1, 2, 3, 4, 5]
20%
[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]
50%
[2, 4, 4, 6, 6, 6, 8, 8, 8, 8, 10, 10, 10, 10, 10]
Check out our awesome emoji pack βοΈ
βοΈ
π π΅
π€ π² π π»
π² π π π π΅
π π π π₯ π΄ π¦
π π π π π π π
β¦
β‘οΈ Boost us in Telegram.
β¦
Please open Telegram to view this post
VIEW IN TELEGRAM
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β€4 2
π22 17β€4π€£4
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β€4 3
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