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 #1771 Β· Back to latest

Older Posts 20 shown
Post #1770 6.81K
πŸ˜† True ...

It's just easy to start.
  • 🀣 64
  • πŸ‘ 9
  • ❀ 4
  • πŸ€” 1
  • 🀩 1
Post #1769 6.24K
  • πŸ‘ 6
  • ❀ 2
  • πŸ”₯ 2
Post #1768 6.15K
CHALLENGE ❓


Promise.resolve(1)
.then(value => {
console.log(value);
throw new Error('Something went wrong');
})
.then(() => {
console.log('This will not run');
})
.catch(error => {
console.log('Caught:', error.message);
return 42;
})
.then(value => {
console.log('Recovered with:', value);
});
  • πŸ‘ 3
  • πŸ€” 2
Post #1767 7.17K
πŸ₯‚ We Did It – 25K Subscribers!

We're excited to announce that our newsletter reached 25,000 subscribers! This was one of our biggest goals for 2024, and we couldn’t have done it without your amazing support.

Thank you for being part of this journey. We’ve got more exciting content coming, so stay tuned!
  • πŸ”₯ 29
  • πŸ‘ 8
  • ❀ 7
  • 🀩 3
Post #1766 6.71K
πŸ‘€ The Story of Web Framework Hono, By Its Creator

Hono is a neat, lightweight framework designed to run on any JavaScript runtime that has been picking up steam in the past year. You can create a simple app reminiscent of Express.js, say, but run it on Cloudflare Workers, Deno, Bun, or Node. It’s in heavy use all over the place, and has lots of interesting features like letting you write HTML with JSX.

Yusuke Wada
  • πŸ‘ 4
  • ❀ 1
  • πŸ”₯ 1
Post #1765 6.66K
  • πŸ”₯ 8
  • ❀ 4
  • πŸ‘ 4
  • 🀣 4
Post #1764 6.98K
CHALLENGE ❓


const map = new Map();
const key1 = {};
const key2 = key1;

map.set(key1, "Value for key1");
map.set(key2, "Value for key2");

console.log(map.get({}));
console.log(map.get(key1));
  • πŸ‘ 3
  • ❀ 1
Post #1763 7.14K
🀟 Node v20.18.0 (LTS) Released; v20 'Iron' Prepares to Bow Out as Active LTS Release

It’s been a quiet few weeks for official releases. This update marks one of the last in Node 20’s run as the active LTS release, and introduces experimental network inspection support. Node 22 will soon take over the active LTS crown (as per schedule) but what will its codename be given there are no elements starting with J? Amazingly, this question was asked six years ago and it's (probably) going to be Jod.

MichaΓ«l Zasso
  • ❀ 7
  • πŸ‘ 4
  • πŸ”₯ 2
Post #1762 6.46K
  • πŸ‘ 8
  • πŸ”₯ 3
  • 🀣 3
  • ❀ 2
Post #1761 6.46K
CHALLENGE ❓


const obj = {};
Object.defineProperty(obj, 'name', {
value: 'Alice',
writable: false,
configurable: false
});

try {
obj.name = 'Bob';
delete obj.name;
console.log(obj.name);
} catch (e) {
console.log('Error:', e.message);
}
  • πŸ”₯ 3
  • πŸ‘ 1
Post #1759 6.63K
  • πŸ€” 13
  • πŸ‘ 7
  • πŸ”₯ 2
  • 🀣 1
Post #1758 6.4K
CHALLENGE ❓


function processData({ a = 10, b = 20 } = { a: 30 }) {
console.log(a, b);
}

processData({ a: 5 });
processData();
  • πŸ‘ 1
Post #1756 6.78K
  • πŸ€” 10
  • πŸ‘ 5
  • ❀ 2
Post #1755 6.61K
CHALLENGE ❓


function* numberGenerator() {
let i = 0;
while (i < 3) {
yield i++;
}
}

const gen = numberGenerator();
console.log(gen.next().value);
console.log(gen.return(10).value);
console.log(gen.next().value);
  • 🀩 4
  • πŸ‘ 2
  • πŸ”₯ 1
Post #1753 6.52K
  • πŸ€” 15
  • πŸ‘ 7
  • ❀ 3
  • 🀩 2
Post #1752 6.27K
CHALLENGE ❓


const obj = Object.freeze({
name: "Alice",
info: {
age: 25
}
});

try {
obj.name = "Bob";
obj.info.age = 30;
} catch (e) {
console.log("Error:", e.message);
}

console.log(obj.name, obj.info.age);
  • πŸ‘ 3
Post #1751 5.95K
πŸ‘€ DOCX 9.0: Generate Word .docx Files from JavaScript

The code to lay out documents is verbose but there’s a lot of functionality baked in and there aren’t many other options for this task. Here’s a CodePen-based example to give you an idea. GitHub repo.

Dolan Miu
  • πŸ‘ 3
  • ❀ 2
  • πŸ”₯ 2
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 β†’