JavaScript
32.1K subscribers
1.06K photos
10 videos
33 files
735 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
❓ CHALLENGE #221

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
πŸ‘©β€πŸ’»πŸ‘©β€πŸ’» The Complete Puppeteer Cheatsheet

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
❓ CHALLENGE #222

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
πŸ‘©β€πŸ’» The Node.js Best Practices List: 2023 Edition

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
❓ CHALLENGE #223

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
πŸ‘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