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
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
What is the output?
Anonymous Quiz
37%
3
42%
4
12%
2
9%
undefined
🀣14❀7πŸ‘6πŸ”₯2πŸ€”2
SPONSORED BY Blacksmith πŸ‘©β€πŸš’
Run GitHub Actions 2x faster at half the cost.

‼️ Astro 4.12: Say Hello to Server Islands

The flexible Astro framework for building modern content-based sites continues to go from strength to strength. v4.12 includes a new concept of server islands, a way to integrate static HTML and server-side generated components together.

Erika and Phillips (Astro)
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘4πŸ”₯3❀2
SPONSORED BY Lantern Cloud πŸ‘―β€β™€οΈ
Vector database on top of Postgres for AI

❓ CHALLENGE

const a = { value: 1 };
const b = Object.create(a);
b.value = 2;

console.log(b.value);
console.log(a.value);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘3
What is the output?
Anonymous Quiz
55%
2, 1
23%
2, 2
16%
1, 2
6%
1, 1
πŸ€”13❀6🀣5πŸ‘4πŸ”₯3🀩1
This media is not supported in your browser
VIEW IN TELEGRAM
SPONSORED BY Lantern Cloud πŸ‘―β€β™€οΈ
Vector database on top of Postgres for AI

🌲 Node.js Adds Experimental Support for TypeScript

Wes Bos
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘6🀣4❀3πŸ”₯1
SPONSORED BY Lantern Cloud πŸ‘―β€β™€οΈ
Vector database on top of Postgres for AI

❓CHALLENGE
let count = 0;

const counter = (function() {
count = 0;
return function() {
count += 1;
return count;
};
})();

count = 10;
counter();
console.log(count);
Please open Telegram to view this post
VIEW IN TELEGRAM
🀩6πŸ‘3πŸ”₯2❀1πŸ€”1
What is the output?
Anonymous Quiz
13%
0
50%
11
29%
1
8%
NaN
πŸ‘9🀩6❀3
SPONSORED BY Lantern Cloud πŸ‘―β€β™€οΈ
Vector database on top of Postgres for AI

πŸ₯ΉπŸ˜‚πŸ˜†emoji-picker-element: A Lightweight Emoji Picker

An emoji picking control, packaged as a Web Component. You can also add custom emoji to it. GitHub repo.

Nolan Lawson
Please open Telegram to view this post
VIEW IN TELEGRAM
❀3πŸ”₯3πŸ‘2
SPONSORED BY Lantern Cloud πŸ‘―β€β™€οΈ
Vector database on top of Postgres for AI

❓CHALLENGE
const target = {
age: 30
};

const handler = {
get: function(obj, prop) {
return obj[prop]++;
}
};

const proxy = new Proxy(target, handler);

console.log(proxy.age);
console.log(target.age);
console.log(proxy.age);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘8πŸ€”7πŸ”₯4❀3
πŸ€”8πŸ‘7❀5
SPONSORED BY Lantern Cloud πŸ‘―β€β™€οΈ
Vector database on top of Postgres for AI

πŸ₯Ά A Different Way to Think About TypeScript

β€œa very expressive way to operate over sets, and using those sets to enforce strict compile time checks”

Robby Pruzan
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘5❀3πŸ”₯3
SPONSORED BY Lantern Cloud πŸ‘―β€β™€οΈ
Vector database on top of Postgres for AI

❓ CHALLENGE

let obj1 = { key: 'value1' };
let obj2 = { key: 'value2' };

const weakMap = new WeakMap();
weakMap.set(obj1, 'data1');
weakMap.set(obj2, 'data2');

obj1 = null;
setTimeout(() => {
console.log(weakMap.has(obj1));
console.log(weakMap.has(obj2));
}, 100);
Please open Telegram to view this post
VIEW IN TELEGRAM
❀5πŸ‘2πŸ€”2🀩1
πŸ”₯11πŸ‘7πŸ€”6❀3
SPONSORED BY Lantern Cloud πŸ‘―β€β™€οΈ
Vector database on top of Postgres for AI

πŸ˜† My code after the refactoring
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣17❀3πŸ‘3
SPONSORED BY Lantern Cloud πŸ‘―β€β™€οΈ
Vector database on top of Postgres for AI

❓CHALLENGE
const target = {
secret: "hidden",
reveal: "nothing"
};

const handler = {
get: function(obj, prop, receiver) {
if (prop === "secret") {
return "revealed";
}
return Reflect.get(...arguments);
}
};

const proxy = new Proxy(target, handler);

with (proxy) {
console.log(secret);
console.log(reveal);
}
Please open Telegram to view this post
VIEW IN TELEGRAM
❀2
πŸ”₯8πŸ€”5πŸ‘4❀2
SPONSORED BY Lantern Cloud πŸ‘―β€β™€οΈ
Vector database on top of Postgres for AI

πŸ˜† ✌️ vs πŸ₯Ά
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣46πŸ‘9❀6πŸ€”2🀩1
CHALLENGE

function* evenNumbers() {
let num = 0;
while (true) {
yield num;
num += 2;
}
}

const gen = evenNumbers();
const evens = Array.from({ length: 4 }, () => gen.next().value).map(n => n + 1);

console.log(evens);
πŸ‘2