31615
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
CHALLENGE
Читать полностью…
function Shape() {}
function Circle(radius) {}
Circle.prototype = Object.create(Shape.prototype);
const shape = new Shape();
console.log(shape instanceof Circle);
CHALLENGE
Читать полностью…
function Animal() {}
function Dog() {}
Dog.prototype = Object.create(Animal.prototype);
const rover = new Dog();
console.log(rover.hasOwnProperty('constructor'));
CHALLENGE
Читать полностью…
function Shape() {}
function Circle(radius) {
this.radius = radius;
}
Circle.prototype = Object.create(Shape.prototype);
Circle.prototype.constructor = Circle;
const shape = new Shape();
const circle = new Circle(5);
console.log(circle instanceof Circle);
console.log(circle instanceof Shape);
console.log(shape instanceof Circle);
console.log(shape instanceof Shape);
CHALLENGE
Читать полностью…
function Animal() {}
function Dog() {}
Dog.prototype = Object.create(Animal.prototype);
const rover = new Dog();
console.log(rover.constructor === Animal);
console.log(rover.constructor === Dog);
console.log(Dog.prototype.isPrototypeOf(rover));
console.log(Animal.prototype.isPrototypeOf(rover));
CHALLENGE
Читать полностью…
function Product(name, price) {
this.name = name;
this.price = price;
}
Product.prototype.discount = function(discount) {
this.price -= discount;
};
const product = new Product('Phone', 500);
product.discount(50);
console.log(product.price);
❓ CHALLENGE
Читать полностью…
const promise = new Promise((resolve, reject) => {
setTimeout(() => reject(new Error('Rejected')), 1000);
});
promise
.then(result => console.log(result))
.catch(error => console.error(error.message))
.then(() => console.log('After catch'))
.then(() => console.log('After then'))
.catch(error => console.error(error.message));
❓ CHALLENGE
Читать полностью…
const promise = new Promise((resolve, reject) => {
setTimeout(() => resolve(3), 1000);
});
promise
.then(result => {
console.log(result);
return result * 2;
})
.then(result => {
console.log(result);
return new Promise(resolve => setTimeout(() => resolve(result * 3), 1000));
})
.then(result => {
console.log(result);
});
❓ CHALLENGE
Читать полностью…
const promise = new Promise((resolve, reject) => {
setTimeout(() => reject(new Error('Error')), 1000);
});
promise
.then(result => console.log(result))
.then(result => console.log(result))
.catch(error => console.error(error.message))
.finally(() => console.log('Finally'));
❓ CHALLENGE
Читать полностью…
function Shape() {}
function Circle(radius) {}
Circle.prototype = Object.create(Shape.prototype);
const shape = new Shape();
console.log(shape instanceof Circle);
❓ CHALLENGE
Читать полностью…
function Person(name) {
this.name = name;
}
Person.prototype.sayName = function() {
console.log('My name is ' + this.name);
};
const john = new Person('John');
console.log(john.sayName === Person.prototype.sayName);
❓ CHALLENGE
Читать полностью…
function Animal() {}
function Dog() {}
Dog.prototype = Object.create(Animal.prototype);
const rover = new Dog();
console.log(rover.constructor === Animal);
❓ CHALLENGE
Читать полностью…
function Animal() {
this.type = 'animal';
}
function Dog() {
this.name = 'dog';
}
Dog.prototype = new Animal();
const rover = new Dog();
const spot = new Dog();
console.log(rover instanceof Dog);
console.log(rover instanceof Animal);
console.log(rover instanceof Object);
console.log(rover === spot);
console.log(rover.constructor === Dog);
console.log(rover.constructor === Animal);
❓ CHALLENGE
Читать полностью…
function Car(make) {
this.make = make;
}
function Truck(make) {
this.make = make;
}
const car = new Car('Toyota');
const truck = new Truck('Toyota');
console.log(car.__proto__ === truck.__proto__);
console.log(car.constructor === truck.constructor);
console.log(car instanceof Truck);
console.log(car instanceof Car);
console.log(Truck.prototype.isPrototypeOf(car));
console.log(Car.prototype.isPrototypeOf(truck));
❓ CHALLENGE
Читать полностью…
console.log('Start');
setTimeout(() => console.log('Timeout'), 0);
Promise.resolve().then(() => console.log('Promise'));
console.log('End');
❓ CHALLENGE
Читать полностью…
console.log('Start');
Promise.resolve().then(() => console.log('Promise'));
const foo = n => {
console.log('Function call');
n > 0 && foo(n - 1);
};
setTimeout(() => foo(2), 0);
🤟 ehmicky/execa-9-release-d0d5daaa097f">Execa 9.0: The Better child_process Gets Even Better
Less shell-oriented than zx, execa focuses on making executing external commands secure, cross-platform, and easy to debug. v9 lets you make commands iterable so you can process their output on the fly, map/filter both input and output, pipe multiple commands, and more. GitHub repo.
EHMICKEY, SORHUS, ET AL.
🏤 Building the most performant web applications with Angular
ArmenVardanyan
Author of "Modern Angular"
Google DevExpert for Angular
👸 Dear Subscribers,
We hope you're enjoying the content on our channel! ❤️
To continue delivering more exciting content, features, and exclusive stories, we're kindly asking telegram premium users to help us take things to the next level.
By boosting our channel, you'll directly contribute to enhancing your viewing experience and supporting the growth of our community.
Thank you for being a part of our journey. 🚀
P.S. Each Premium user can boost 4 times.
/channel/javascript?boost
👀 Pintora: An Extensible Text-to-Diagram Rendering Library
A similar idea to Mermaid but with a different attitude to extensibility as well as no requirement for a headless browser server-side. The intro docs have both visual and code examples.
HIKERPIG
😉 Seamless Drag and Drop Between Applications
A fantastic demonstration of using browser APIs to create more elegant drag and drop experiences that even work across different browser windows or IFRAMEs, with Atlassian’s Pragmatic Drag and Drop library doing the heavy lifting.
ALEX REARDON
😱 Development Notes from xkcd's 'Machine'
I bet many of you are fans of xkcd! For this year’s April Fools’ joke, they published ‘Machine’, a giant Rube Goldberg machine of sorts (explained here). With a lot of TypeScript up front and Haskell in the back, here’s how it works at a technical level. (GitHub repo.)
MAX GOODHART
🏤 Demystifying the push & pull nature of Angular Signals
Tomas Trajan
😉Postgres is all you need for your AI application (EN)
Varik Matevosyan
Software Engineer (Lantern, YC W24)
🤟 Five Node Version Managers Compared
In an ideal world, the latest version of Node would slot well into every project, but in reality we often need to switch versions, and a variety of tools are available to make it simple. NVM is perhaps the best known, but maybe N, FNM, Volta, or even pnpm could suit you better?
PAVEL ROMANOV
👀 DerbyJS 4.0: The Mature MVC Web Framework
It’s never been the most popular of the frameworks, but Derby has lived through most of Node’s history and remains a viable option for building realtime, collaborative apps in particular. GitHub repo.
NATE SMITH ET AL.
😯 Virtual x86: x86 Virtualization with JS and WASM
Run Linux, numerous older versions of Windows, BSD, MS-DOS, and other systems right in the browser (and quickly, too). Not a new project, but I’m always impressed how it’s constantly getting updates. GitHub repo.
FABIAN HEMMER
🍿 Emoji Mart 5.6
Emoji selection component for the Web.
🍊 extension.js: Zero-Config, Cross Browser Extension Dev Starter
The goal is to make it as simple as a npx extension create my-extension to get started with building your own browser extensions. GitHub repo.
CEZAR AUGUSTO