javascript | Unsorted

Telegram-канал javascript - JavaScript

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

Subscribe to a channel

JavaScript

CHALLENGE


const obj = {
a: 1,
then(resolve) {
resolve(this.a);
}
};

obj.then(console.log);

Читать полностью…

JavaScript

CHALLENGE


const array = [1, 2, 3];
array[-1] = 0;

console.log(array.length);

Читать полностью…

JavaScript

CHALLENGE


const obj1 = { a: 1 };
const obj2 = Object.create(obj1);
obj2.b = 2;

const result = 'a' in obj2;

console.log(result);

Читать полностью…

JavaScript

CHALLENGE


const array = Array.from({ length: 5 }, () => Math.random() > 0.5);

console.log(array);

Читать полностью…

JavaScript

🥲 hubs.la/Q02HbH-80

Читать полностью…

JavaScript

🌲 What is new in Node.js V22.5

In this article, we will review the notable changes introduced in the new Node.js version:

- node:sqlite module
- add matchesGlob method
- add postessageToThread method

nairihar

Читать полностью…

JavaScript

CHALLENGE


function Foo() {
this.bar = 1;
}

Foo.prototype.bar = 2;

const foo = new Foo();
console.log(foo.bar);

Читать полностью…

JavaScript

CHALLENGE


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

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

console.log(samePrototype);

Читать полностью…

JavaScript

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);

Читать полностью…

JavaScript

CHALLENGE


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

obj1.b.c = 3;

console.log(obj2.b.c);

Читать полностью…

JavaScript

CHALLENGE


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

console.log(result);

Читать полностью…

JavaScript

CHALLENGE


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

const b = obj.b;
console.log(b.call({ a: 2 }));

Читать полностью…

JavaScript

CHALLENGE


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

console.log(array.length);
console.log(array.includes(undefined));

Читать полностью…

JavaScript

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);

Читать полностью…

JavaScript

CHALLENGE


const array = [1, 2, 3, 4, 5];
const [first, ...rest] = array;

const modified = rest.map((n, i) => i % 2 === 0 ? n * 2 : n);

console.log(first, modified);

Читать полностью…

JavaScript

👩‍🦯 es-toolkit: A Modern JavaScript Utility Library

Think Lodash but newer, faster, smaller, and with tree shaking and built-in TypeScript support. The reference guide shows off the supported functions so far – it’s not quite as extensive as Lodash, but it’s getting there with the goal being “to achieve full feature parity with Lodash.”

Viva Republica, Inc

Читать полностью…

JavaScript

🌕 How to Make Complex Chrome Extensions

Spinning up a quick, simple browser extension isn’t that big of a deal nowadays, especially with tools like Extension to kick off a project. Larger extensions are a different story, so it’s neat to learn from the experiences of a team that’s built one.

Nina Torgunakova

Читать полностью…

JavaScript

🔵 React Flow 12: Create Node-Based Editors & Interactive Diagrams

Part of xyflow, this makes it easy to create node-based UIs where you have interactive components wired together however you choose. There's a Svelte version too.

Moritz Klack and John Robb

Читать полностью…

JavaScript

✌️ JavaScript weekly #697

Читать полностью…

JavaScript

CHALLENGE


const func = () => arguments.length;
console.log(func(1, 2, 3));

Читать полностью…

JavaScript

🌲 Check the latest updates of Nairi's long article about EventLoop

— Unblocking EventLoop using unref() (added in Jul of 2024)

— A challenging interview question (added in Feb of 2024)

nairihar

Читать полностью…

JavaScript

🤩 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

Читать полностью…

JavaScript

⚡️ 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

Читать полностью…

JavaScript

😆

Читать полностью…

JavaScript

👀 Top Programming Language to Learn in 2024

hovdallakyan">@hovdallakyan

Читать полностью…

JavaScript

✌️ JavaScript weekly #​696

Читать полностью…

JavaScript

📊 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

Читать полностью…

JavaScript

✌️ 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

Читать полностью…

JavaScript

😂

Читать полностью…

JavaScript

😆

Читать полностью…
Subscribe to a channel