JavaScript
31.9K subscribers
1.01K photos
9 videos
33 files
693 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
πŸ˜†
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣89πŸ‘3🀩3
CHALLENGE

const promise = new Promise((resolve, reject) => {
reject('Error occurred');
});

promise
.then(() => {
console.log('Promise resolved!');
})
.catch(error => {
console.log(error);
})
.then(() => {
console.log('Process completed');
});
πŸ‘5πŸ”₯3
πŸ‘€ Style Observer: A Library to Observe CSS Property Changes

Lea Verou is a developer who’s easy to admire because whenever she sets out to solve a problem, the results are always fully formed with no cut corners. So it goes with this β€˜exhaustively tested’ JS library for observing changes to CSS properties which deftly handles lots of browser quirks. See the project homepage for more. (TIL there’s a .style TLD!)

Lea Verou
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘5πŸ€”4❀2
CHALLENGE


let weakmap = new WeakMap();

let obj1 = {};
let obj2 = {};

weakmap.set(obj1, 'value1');
weakmap.set(obj2, 'value2');

obj1 = null;

console.log(weakmap.has(obj1));
❀8πŸ‘1
What is the output?
Anonymous Quiz
24%
undefined
15%
TypeError
35%
true
26%
false
πŸ”₯10πŸ€”9🀣6πŸ‘5
✌️πŸ₯Ά Ohm: A Parsing Toolkit for JavaScript and TypeScript

It’s been a few years since we covered this project and it’s come along a lot. It’s a library for building PEG-based parsers you can use in interpreter, compilers, analysis tools, etc. and you can even play with its grammar online.

Warth, Dubroy, et al.
Please open Telegram to view this post
VIEW IN TELEGRAM
❀3πŸ‘3πŸ€”1
CHALLENGE

function Person(name, age) {
this.name = name;
this.age = age;
}

Person.prototype.getDetails = function() {
return this.name + ' is ' + this.age + ' years old.';
};

const john = new Person('John', 25);
console.log(john.getDetails());
πŸ‘11❀1
πŸŒͺ GitHub Extends Its Monaspace Font Family

Monaspace is a fantastic set of monospaced fonts from GitHub targeted at coding use cases. Its new v1.2 release ups the ante by including Nerd Fonts support and symbols, new box drawing glyphs, characters, character variants, ligatures, and more.

GitHub
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘10❀2πŸ”₯1🀣1
CHALLENGE

const obj1 = { a: 1, b: 2 };
const obj2 = { b: 3, c: 4 };
const mergedObj = { ...obj1, ...obj2 };
console.log(mergedObj);
πŸ‘10
πŸ”₯16πŸ‘11🀣8❀5🀩1
πŸ€” How and Why to Build 'Copy Code' Buttons

A commonly encountered way to give readers easier access to source shared on the Web. David Bushell has an interesting followup reflecting on his own experiences implementing the same feature.

Salma Alam-Naylor
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘8❀2πŸ”₯2
CHALLENGE

let person = {
name: 'Alice',
age: 30,
valueOf: function() {
return this.age;
}
};

let result = person + 10;
console.log(result);
πŸ‘10❀4πŸ”₯1πŸ€”1
What is the output?
Anonymous Quiz
35%
[object Object]10
20%
undefined
8%
30
38%
40
🀣32πŸ€”23πŸ‘11❀3
3🀣30❀22πŸ‘7πŸ”₯5πŸ€”4
About the post above ☝️ πŸ˜‚
Please open Telegram to view this post
VIEW IN TELEGRAM
1🀣39πŸ‘8πŸ”₯6❀2
CHALLENGE

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

const result = numbers
.filter(num => num % 2 === 0)
.map(num => num * num)
.reduce((acc, num) => acc + num, 0);

console.log(result);
πŸ‘13❀2🀣1
What is the output?
Anonymous Quiz
16%
30
12%
29
11%
9
61%
20
πŸ”₯25πŸ‘8πŸ€”8❀2🀣1