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
πŸ‘17πŸ€”7❀5🀩2
πŸ˜‚
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣99πŸ‘12πŸ”₯3πŸ€”31
❓ CHALLENGE #224

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, isSenior: person.age > 30 }))
.sort((a, b) => a.age - b.age)
.slice(0, 2)
.reduce((acc, person) => {
acc[person.name] = person.isSenior;
return acc;
}, {});

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
❀5πŸ‘3πŸ€”3
πŸͺ The Await Event Horizon in JavaScript

You know someone’s getting heavy when they start a JavaScript article by talking about the event horizon around black holes and how β€œa similar boundary exists around every JavaScript Promise.” Enjoy.

CHARLES LOWELL
πŸ”₯7❀5πŸ‘5
❓ CHALLENGE #225

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

const result = data.map(num => Array.from({ length: num }, (_, index) => index + 1));

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘3❀1
🌍 Three.js Procedural Planets

This is gorgeous! You can have a lot of fun adjusting the parameters to change the outcome, or you can spin up and play with your own copy using the source code. If you don’t want to stress out your browser, you can see how it looks ▢️ in this video.

DANIEL GREENHECK
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯5❀4πŸ‘4
❓ CHALLENGE #226

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

const result = data.flatMap(num => Array.from({ length: num * 2 - 1 }, (_, index) => index % 2 === 0 ? num : index + 1));

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
❀5πŸ‘2
😐 You don't need JavaScript for that

β€œJust because you know something needs JavaScript, doesn’t mean it still does. You can make better websites if you test those assumptions every now and then.”

KILLIAN VALKHOF
Please open Telegram to view this post
VIEW IN TELEGRAM
❀9πŸ‘4πŸ”₯2🀣2
πŸŽ„Merry Christmas to all the members of our JavaScript community!

P.S. Dear premium Telegram users, this Christmas, the gift is in your hands! Boost us on Telegram for free, and your support becomes the festive present to all of us (it enables features like stories and more). 🌟
Please open Telegram to view this post
VIEW IN TELEGRAM
❀30πŸ‘5πŸ”₯4🀩33🀣2
❓ CHALLENGE #227



if (false) {
function foo() {
return 1;
}
}

console.log(foo());
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘12❀1
18πŸ‘10❀3
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘134❀3
❓ CHALLENGE #228

const numbers = [2, 4, 6, 8, 10];

const result = numbers.reduce((acc, val) => {
acc[val] = val * 2;
return acc;
}, {});

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
❀6πŸ‘1
⭐️As 2023 comes to a close, let's wrap it up with a swift survey to pinpoint everyone's favorite frameworks.
Please open Telegram to view this post
VIEW IN TELEGRAM
What are your favorite frontend frameworks?
Anonymous Poll
76%
React
17%
Angular
14%
Vue.js
5%
Svelte
3%
Astro
20%
Next.js
3%
Remix
6%
htmx
35πŸ€”9❀5πŸ‘3