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
πŸ‘5πŸ”₯3❀2
CHALLENGE

console.log('Start');

setTimeout(() => {
console.log('Timeout 1');
}, 0);

Promise.resolve().then(() => {
console.log('Promise 1');
}).then(() => {
console.log('Promise 2');
});

setTimeout(() => {
console.log('Timeout 2');
}, 0);

console.log('End');
❀4
✌️ You Don't Know JS Yet: The Unbooks

This ~420pg ebook is a collection of all 4 remaining "unbooks" of the 2nd edition of "You Don't Know JS Yet" book series.

Kyle Simpson
Please open Telegram to view this post
VIEW IN TELEGRAM
1πŸ‘10❀4πŸ”₯4πŸ€”1
CHALLENGE

const a = 9007199254740991n;
const b = 2n;

function performCalculation() {
const c = a + 1n;
const d = c / b;
const e = d * 2n - 1n;

const result = Number(e) === Number(a);
console.log(result);
}

performCalculation();
πŸ‘7
πŸ‘11πŸ€”6❀4
CHALLENGE


const obj = {
[Symbol('a')]: 'hidden',
a: 'visible',
[Symbol.for('b')]: 'registered',
b: 123
};

const symbol1 = Symbol.for('b');
const symbol2 = Symbol.for('b');

console.log(obj.a + ', ' +
obj[Symbol('a')] + ', ' +
obj[symbol1] + ', ' +
(symbol1 === symbol2));
❀2πŸ”₯2πŸ‘1
πŸ‘ p5.js 2.0: The JavaScript Library for Creative Coding

A popular Processing-inspired creative coding library that makes it easy to create interactive, visual experiences (examples). v2.0 improves its font support, adds more ways to draw and manipulate text, adds a way to write shaders in JavaScript, and much more. p5.js 2.0: You Are Here has more details on the release and where the project is headed next.

p5.js Team
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘7πŸ”₯2❀1
CHALLENGE

function* counter() {
let i = 0;
while (true) {
const direction = yield i;
if (direction === 'up') i += 2;
else if (direction === 'down') i -= 1;
else i += 1;
}
}

const count = counter();
console.log(count.next().value);
console.log(count.next('up').value);
console.log(count.next('down').value);
console.log(count.next().value);
πŸ‘1πŸ”₯1
πŸ‘4❀3πŸ”₯3
🀨 Creating a 3D Split-Flap Display with JavaScript

A split-flap display is a electro-mechanical display commonly associated with live timetable displays and it makes for a neat effect on the Web too. Jhey breaks down how to replicate it, or you can hit up this live demo.

Jhey Tompkins
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘7πŸ”₯3❀1πŸ€”1
CHALLENGE

function* genSequence() {
const result = yield 'first';
console.log(result);
yield* [1, 2];
return 'done';
}

const gen = genSequence();
let next = gen.next('ignored');
console.log(next.value);
next = gen.next('second');
next = gen.next();
console.log(next.value);
next = gen.next();
console.log(next);
πŸ‘3❀2πŸ”₯1
✌️ JavaScript Font Picker

A surprisingly featureful control for letting users pick fonts from a range of system fonts, Google fonts, and custom fonts of your choice. You can play with a code demo here or go to the GitHub repo.

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

function Animal(name) {
this.name = name;
}

Animal.prototype.getName = function() {
return this.name;
};

function Dog(name, breed) {
Animal.call(this, name);
this.breed = breed;
}

Dog.prototype = Object.create(Animal.prototype);
Dog.prototype.constructor = Dog;

Dog.prototype.getName = function() {
return `Dog called ${Animal.prototype.getName.call(this)}`;
};

const myDog = new Dog('Rex', 'German Shepherd');
console.log(myDog.getName());
πŸ”₯5❀1πŸ‘1
πŸ”₯4❀1πŸ‘1
🀟 Koa 3.0: The Expressive HTTP Middleware Framework

Koa first appeared over a decade ago as a β€˜next-generation’ Web framework that shared some of the lineage (and team) of Express.js, but leaning on more modern JavaScript features and ideas of the time. While Express has been making a comeback recently, Koa has progressed too and offers a compelling alternative. v3.0 release notes.

Koa contributors
Please open Telegram to view this post
VIEW IN TELEGRAM
❀7🀩2πŸ‘1πŸ”₯1
CHALLENGE

const obj = {
value: 42,
getValue() {
return this.value;
},
getValueArrow: () => this.value,
nested: {
value: 100,
getValue() {
return this.value;
}
}
};

const extractedMethod = obj.getValue;
const boundMethod = obj.getValue.bind(obj);

console.log(obj.getValue() + ',' + obj.getValueArrow() + ',' +
obj.nested.getValue() + ',' + extractedMethod() + ',' +
boundMethod());
❀2