TGViewer
Channel Public Channel
JavaScript

JavaScript

@javascript

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
Subscribers
31K
Photos
1.2K
Videos
10
Links
900

Showing posts older than #1731 Β· Back to latest

Older Posts 20 shown
Post #1730 6.53K
  • πŸ‘ 11
  • ❀ 4
  • πŸ”₯ 4
Post #1729 6.21K
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');
  • ❀ 4
Post #1728 6.73K
✌️ 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
  • πŸ‘ 13
  • 🀣 3
  • ❀ 2
  • πŸ”₯ 1
Post #1727 6.76K
  • 🀣 26
  • πŸ‘ 8
  • ❀ 2
Post #1726 6.55K
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);
  • πŸ‘ 5
  • ❀ 3
  • πŸ”₯ 2
Post #1725 7.04K
😒 Why?
  • 🀣 101
  • πŸ€” 8
  • πŸ”₯ 7
  • 🀩 4
  • πŸ‘ 2
Post #1724 6.56K
  • πŸ‘ 11
  • ❀ 5
  • πŸ”₯ 1
Post #1723 6.54K
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);
  • πŸ‘ 5
  • 🀩 2
  • πŸ”₯ 1
Post #1721 6.51K
  • πŸ€” 14
  • πŸ‘ 8
  • πŸ”₯ 7
  • ❀ 3
Post #1720 6.47K
CHALLENGE ❓

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

obj.method();
  • πŸ€” 10
  • πŸ‘ 6
Post #1719 6.69K
🀟 ¡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
  • πŸ”₯ 3
  • πŸ‘ 2
  • ❀ 1
Post #1718 6.3K
  • ❀ 12
  • πŸ€” 1
Post #1717 6.2K
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');
  • πŸ‘ 5
Post #1716 6.75K
✌️ 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
  • πŸ‘ 6
  • ❀ 3
  • πŸ”₯ 1
Post #1715 6.06K
  • πŸ€” 23
  • πŸ”₯ 11
  • πŸ‘ 6
  • ❀ 4
  • 🀣 2
  • 🀩 1
Post #1714 6.48K
CHALLENGE ❓

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

copy.a.push(4);

console.log(original.a);
console.log(copy.a);
  • πŸ”₯ 5
  • πŸ‘ 1
Post #1712 6.57K
  • 🀣 42
  • πŸ€” 18
  • πŸ‘ 15
  • πŸ”₯ 5
  • ❀ 1
Post #1711 6.35K
CHALLENGE ❓


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

test();
  • πŸ‘ 17
Older posts β†’
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook β†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 β†’