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
CHALLENGE

function* numberGenerator() {
yield 1;
yield 2;
yield 3;
}

const gen = numberGenerator();
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
πŸ‘11❀2πŸ”₯1
πŸ‘5πŸ€”3
🀟 How to Publish ESM-Based npm Packages with TypeScript

Now that you can use the ES modules (almost) everywhere, it’s worth understanding how to package them up for use with npm. Axel digs into everything you need to know and shares some useful tools too.

Dr. Axel Rauschmayer
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘4❀3πŸ”₯1
CHALLENGE

const symbol1 = Symbol('symbol');
const symbol2 = Symbol('symbol');

const obj = {};
obj[symbol1] = 'value1';
obj[symbol2] = 'value2';

console.log(obj[symbol1]);
πŸ‘4
What is the output?
Anonymous Quiz
17%
undefined
11%
'value2'
10%
Error
62%
'value1'
πŸ‘8❀3πŸ”₯2
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣23πŸ‘8❀4🀩1
CHALLENGE

function outerFunction() {
let x = 10;
function innerFunction() {
x += 5;
console.log(x);
}
return innerFunction;
}

const closureFunc = outerFunction();
closureFunc();
closureFunc();
πŸ€”12πŸ‘10
What is the output?
Anonymous Quiz
30%
10, 15
33%
15, 20
34%
15, 15
3%
20, 25
πŸ‘10πŸ€”9🀣4❀2
πŸ˜†
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
27%
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