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
CHALLENGE

const obj = { a: 1, b: 2 };
const proxy = new Proxy(obj, {
get(target, prop) {
return prop in target ? target[prop] : 0;
}
});

console.log(proxy.a, proxy.b, proxy.c);
❀11πŸ”₯3πŸ‘2
❀6
✌️ How to Annul Promises in JavaScript

You can 'cancel' XHR and fetch requests, but can you cancel regular promises? Currently, no, but Zachary looks into doing the next best thing: telling a promise the game's up, and discarding/ignoring its eventual results.

Zachary Lee
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘7
CHALLENGE

const array = [1, 2, 3];
array[10] = 4;

console.log(array.length);
console.log(array.includes(undefined));
πŸ‘21πŸ€”12❀11🀣6
πŸ“Š Sliderland: A Minimalist Coding Playground

A slider control based visualization you can code with simple formulas. We last linked to this a few years ago, but it’s still a fun way to do some quick, visual JS math experimentation. Tixy.land is along similar lines, but based on a 2D grid.

blinry
Please open Telegram to view this post
VIEW IN TELEGRAM
❀8πŸ‘4πŸ”₯1
CHALLENGE

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

const b = obj.b;
console.log(b.call({ a: 2 }));
πŸ‘20❀5🀩2
What is the output?
Anonymous Quiz
54%
2
20%
1
17%
undefined
9%
Error
πŸ‘2
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯4❀3🀩3
CHALLENGE

const array = [1, 2, 3, 4, 5];
const result = array.some(n => n % 2 === 0) && array.every(n => n < 10);

console.log(result);
πŸ‘5❀4
What is the output?
Anonymous Quiz
53%
true
19%
false
21%
[1, 2, 3, 4, 5]
8%
Error
πŸ”₯9πŸ‘5❀3
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘14❀6πŸ”₯4
CHALLENGE

const obj1 = { a: 1, b: { c: 2 } };
const obj2 = { ...obj1 };

obj1.b.c = 3;

console.log(obj2.b.c);
πŸ‘7❀6
What is the output?
Anonymous Quiz
10%
Error
18%
undefined
50%
3
23%
2
πŸ€”15πŸ‘6🀩2❀1
πŸ˜†
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣104❀4🀩3πŸ”₯1
CHALLENGE

const arr = [1, 2, 3, 4, 5];
const sliced = arr.slice(1, 3);
const spliced = arr.splice(1, 3);

console.log(sliced, spliced, arr);
πŸ‘13
πŸ‘23πŸ”₯9❀3πŸ€”3🀩2
This media is not supported in your browser
VIEW IN TELEGRAM
⚑️ Dynamically loaded extensions in Postgres in the browser

At a recent AGI House hackathon in San Francisco, we set out to run our Postgres vector extension directly in the browser. This would allow our documentation examples and small demos to be fully executable within the browser using a Postgres instance compiled to Wasm and running on the client browser.

lantern
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯8❀4πŸ‘3🀩2πŸ€”1
CHALLENGE

const obj = { a: 1, b: 2 };
const obj2 = { ...obj, b: 3 };

const samePrototype = Object.getPrototypeOf(obj) === Object.getPrototypeOf(obj2);

console.log(samePrototype);
What is the output?
Anonymous Quiz
17%
undefined
14%
Error
35%
false
34%
true
πŸ‘16πŸ”₯6πŸ€”5❀4
🀩 BWIP-JS: A Barcode Writer in Pure JavaScript

A library that can generate barcodes using over 100 different barcode types and standards, both single and two dimensional. There is, of course, a live demo where you, too, can discover far more types of barcodes exist than you ever imagined.

Mark Warren
Please open Telegram to view this post
VIEW IN TELEGRAM
❀5πŸ”₯5πŸ‘3