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

🌪 Run your GitHub Actions locally

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

JavaScript

👩‍🦯 ESLint now officially supports linting of JSON and Markdown

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

JavaScript

😂

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

JavaScript

🔥 How an incredibly amateur mistake left Arc Browser wide open to hackers

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

JavaScript

😉Bundling: The Past, Present and Future

A history lesson on bundlers, why they’re used, the problems they solve, the current ecosystem, and a look at the potential future for these tools.

Devon Govett

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

JavaScript

✌️ VoidZero: A Next-Generation Toolchain for JavaScript

Not content to have merely created Vue.js and Vite, JavaScript powerhouse Evan You has unveiled his latest adventure: a $4.6m funded company building an open-source unified development toolchain for the JavaScript ecosystem. With his track record, this is as good an attempt as it gets.

Evan You

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

JavaScript

😢 Why?

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

JavaScript

👍 gradient-string 3.0: Beautiful Color Gradients in Terminal Output

What’s the next step up from colorizing the text output of your Node-powered CLI app? Gradients. v3.0 is rewritten in TypeScript and is a pure ES module.

Boris K

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

JavaScript

🤟 µExpress / Ultimate Express: Like Express, But Faster?

It’s not Express, but a reimplementation of Express’s functionality with API compatibility. Based on µWebSockets, and with an optimized router, it boasts faster performance than regular Express, but needs some C++ magic to make it happen.

dimden

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

JavaScript

✌️ Don't Sleep on AbortController

AbortController is a broadly available mechanism for, originally, aborting Web requests on demand, but you can use it for a lot more than that (or ‘anything!’, as Artem explains).

Artem Zakharchenko

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

JavaScript

👀 Schedule-X 2: A Modern Event Calendar Component

Available in the form of React/Preact, Vue, Svelte, Angular, or plain JS components. Open source but with a premium version with extra features. GitHub repo.

Tom Österlund

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

JavaScript

👀 Mathematical Symbols and JavaScript Equivalents

We’re not just talking the obvious like + and - but things like ⁿ√, Σ, Π, ∃, and set notation.

Joshua Nussbaum

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

JavaScript

💻 Deno 2 is here… will it actually kill Node.js this time?

🔥 Fireship

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

JavaScript

👍 Chokidar 4.0: Efficient Cross-Platform File Watching Library

Wraps around fs.watch / fs.watchFile and normalizes the events received, applies some best practices, and presents an API that works the same across different platforms.

Paul Miller

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

JavaScript

😉 From Node.js to Deno: How It All Began

A brief nine minute documentary exploring the origins of Deno with Ryan Dahl and Bert Belder. A good, quick way to get up to speed with the motivations behind the alternative JavaScript runtime.

Honeypot

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

JavaScript

CHALLENGE ❓


async function asyncFunc() {
console.log('Async Start');
await new Promise(resolve => setTimeout(resolve, 100));
console.log('Async End');
}

console.log('Script Start');
asyncFunc();
setTimeout(() => console.log('Timeout 1'), 50);
setTimeout(() => console.log('Timeout 2'), 150);
console.log('Script End');

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

JavaScript

CHALLENGE ❓


setTimeout(() => {
console.log('setTimeout 1');
Promise.resolve().then(() => console.log('Promise 1'));
}, 0);

Promise.resolve().then(() => {
console.log('Promise 2');
setTimeout(() => console.log('setTimeout 2'), 0);
});

console.log('Sync');

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

JavaScript

CHALLENGE ❓


console.log('A');
setTimeout(() => console.log('B'), 0);
Promise.resolve().then(() => console.log('C'));
console.log('D');

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

JavaScript

CHALLENGE ❓


console.log(1);
setTimeout(() => console.log(2), 0);
Promise.resolve()
.then(() => {
console.log(3);
return Promise.resolve(4);
})
.then(console.log);
console.log(5);

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

JavaScript

CHALLENGE ❓


async function fetchData() {
console.log('Fetching...');
await new Promise((resolve) => {
setTimeout(() => {
console.log('Data fetched');
resolve();
}, 100);
});
console.log('Process completed');
}

fetchData();
console.log('End of script');

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

JavaScript

CHALLENGE ❓


const arr = [1, 2, 3];
const newArr = arr.map(num => num * 2);

newArr.push(4);
arr[0] = 0;

console.log(arr);
console.log(newArr);

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

JavaScript

CHALLENGE ❓


function* generatorFunction() {
yield 1;
yield* function* () {
yield 2;
yield 3;
}();
yield 4;
}

const gen = generatorFunction();
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);

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

JavaScript

CHALLENGE ❓


const obj = {
value: 100,
method: function() {
const inner = function() {
console.log(this.value);
};
inner();
}
};

obj.method();

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

JavaScript

CHALLENGE ❓


const promise = new Promise((resolve) => {
console.log('Promise started');
setTimeout(() => {
resolve('Promise resolved');
}, 100);
});

promise.then((result) => {
console.log(result);
});

console.log('End of script');

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

JavaScript

CHALLENGE ❓


const original = Object.freeze({ a: [1, 2, 3] });
const copy = { ...original };

copy.a.push(4);

console.log(original.a);
console.log(copy.a);

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

JavaScript

CHALLENGE ❓


var a = 5;
function test() {
console.log(a);
var a = 10;
console.log(a);
}

test();

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

JavaScript

CHALLENGE ❓


const animal = {
sound: "Generic sound",
makeSound() {
return this.sound;
}
};

const dog = Object.freeze(Object.create(animal));
dog.sound = "Bark";

const result = dog.makeSound();

console.log(result);

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

JavaScript

CHALLENGE ❓


const person = {
name: "John",
greet: function() {
const getMessage = () => `Hello, ${this.name}`;
return getMessage();
}
};

console.log(person.greet());

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

JavaScript

CHALLENGE ❓


let funcs = [];

for (var i = 0; i < 3; i++) {
funcs.push(() => i);
}

console.log(funcs[0]());
console.log(funcs[1]());
console.log(funcs[2]());

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

JavaScript

CHALLENGE ❓


function tag(strings, ...values) {
return strings.reduce((acc, str, i) => {
return acc + str + (values[i] ? values[i].toUpperCase() : '');
}, '');
}

const first = "hello";
const second = "world";

const result = tag`${first} and ${second} are great!`;

console.log(result);

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