JavaScript
32K subscribers
1.04K photos
10 videos
33 files
718 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
What is the output?
Anonymous Quiz
26%
1
47%
2
19%
undefined
8%
Error
πŸ‘19
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

✌️ I am not... I repeat, I am not... a "frontend developer", just because I like to write JS.

I'm also not a "backend developer" b/c I like to write communication-oriented code, to manage and transmit data and juggle asynchony and other non-UI stuff.
I'm a middle-end dev. Forever. I build libraries, tools, etc. My product is what another dev uses to build their product.

Kyle Simpson
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘9πŸ”₯7❀4
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

CHALLENGE ❓


const array = [1, 2, 3, 4];
const result = array.reduceRight((acc, val) => acc - val);

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
What is the output?
Anonymous Quiz
21%
2
28%
-8
32%
-2
19%
Error
πŸ‘9❀8πŸ”₯4
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

✌️ JavaScript weekly #698
Please open Telegram to view this post
VIEW IN TELEGRAM
❀5πŸ‘5πŸ”₯2πŸ€”2🀣1
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

CHALLENGE ❓


function test() {
console.log(arguments.length);
}

test(1, 2, 3);
test.call(null, 1, 2, 3);
Please open Telegram to view this post
VIEW IN TELEGRAM
❀6πŸ‘6πŸ”₯2
What is the output?
Anonymous Quiz
43%
3, 3
22%
3, 0
24%
0, 3
12%
0, 0
πŸ‘14❀6
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

🌲 Graceful Shutdown in NodeJS

In this article, I will show you how to do a graceful shutdown in a NodeJS application, but first, let's describe what "graceful shutdown" means and why we need to do that in our application and what are the benefits.

nairihar
Please open Telegram to view this post
VIEW IN TELEGRAM
❀6πŸ”₯3πŸ‘2
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

CHALLENGE ❓


const obj = { a: 1, b: 2 };
const descriptor = Object.getOwnPropertyDescriptor(obj, 'a');

descriptor.value = 3;
Object.defineProperty(obj, 'a', descriptor);

console.log(obj.a);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘6❀4πŸ”₯3
What is the output?
Anonymous Quiz
25%
1
14%
2
52%
3
9%
Error
πŸ‘3
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

The newer CSS viewport units (svh, lvh, dvh) are one of my favourite features in modern CSS
πŸ”₯

β†’ The "smallest viewport height" (svh) will always fit the smallest amount of space (all content will always be visible)

β†’ The "largest viewport height" (lvh) will always take up the largest amount of space (potentially hiding some content underneath UI)

β†’ The "dynamic viewport height" (dvh) will resize to fit the currently available space (adapting as the browser UI gets visible or hidden)

Mads Brodt
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯16❀7πŸ‘5
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

CHALLENGE ❓


const array = [1, 2, 3];
const result = array.map(function(n) {
return this ? n : 0;
}, false);

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘6❀4πŸ”₯3
❀10πŸ€”6πŸ‘3πŸ”₯3🀩3
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

πŸ‘€ Ky: Tiny, Elegant Fetch-Based HTTP Client for Browsers

Makes the Fetch API tidier to use as shown here. If you want to tighten up your fetch calls, it's worth a look.

Sindre Sorhus
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘7❀4πŸ”₯2
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

CHALLENGE ❓


function* generator() {
yield* [1, 2];
yield* (function* () { yield 3; yield 4; })();
}

const gen = generator();

console.log([...gen]);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯7πŸ‘4❀2
πŸ‘8πŸ€”4🀣4❀3
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

πŸ˜‰ Don't Use JS for That: Moving Features to CSS and HTML by Kilian Valkhof

Packed with code and examples. Some techniques aren’t universally supported yet, but there’s a lot that the browser can offer that you don’t need to reimplement yourself, like color picking, modals, and animations.

Kilian Valkhof
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘7❀2πŸ”₯2
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

CHALLENGE ❓


const obj = {
a: 1,
b() {
return this.a + 1;
}
};

const { b } = obj;
console.log(b());
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘1
What is the output?
Anonymous Quiz
57%
2
12%
1
20%
undefined
11%
NaN
πŸ€”23πŸ‘9πŸ”₯5❀3
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

❓ So You Think You Know Box Shadows?

The author indulges his creative side with some fun experiments into what he calls β€œsome of the worst possible things” you can do with box shadows on a DIV element, coupled with JavaScript.

David Gerrells
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯3❀2πŸ‘2
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

CHALLENGE ❓


const obj = { a: 1, b: 2 };
Object.defineProperty(obj, 'b', { value: 3, writable: false });

obj.b = 4;
console.log(obj.b);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘5πŸ”₯2πŸ€”1