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
901

Showing posts older than #1611 ยท Back to latest

Older Posts 20 shown
Post #1610 5.77K
  • ๐Ÿ‘ 8
  • ๐Ÿ”ฅ 4
  • ๐Ÿค” 3
  • โค 1
Post #1609 5.89K
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

โ“ CHALLENGE


const weakMap = new WeakMap();
const arr = [1, 2, 3].map(n => ({ n }));

arr.forEach(obj => weakMap.set(obj, obj.n * 2));

arr.pop(); // Remove the last element

const result = arr.reduce((acc, obj) => acc + weakMap.get(obj), 0);

console.log(result);
  • โค 2
Post #1608 5.78K
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

โœŒ๏ธ Regexes Got Good: The History (and Future) of Regular Expressions in JavaScript

Regular expression support was always a little underwhelming in JS, but things have improved. Steven takes us on a tour to refresh our knowledge, as well as show off his โ€˜regexโ€™ library that boosts JS regexes to a true A++ rating. Steven was co-author of Oโ€™Reillyโ€™s Regular Expressions Cookbook and High Performance JavaScript so knows his stuff.

Steven Levithan
  • ๐Ÿ‘ 6
  • ๐Ÿ”ฅ 5
  • โค 3
Post #1606 6.24K
  • ๐Ÿ‘ 14
  • ๐Ÿค” 7
  • ๐Ÿ”ฅ 5
  • โค 3
Post #1605 6.01K
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

โ“ CHALLENGE


const obj1 = {
name: "Alice",
age: 25
};

const obj2 = {
age: 30,
city: "Wonderland"
};

with (obj1) {
with (obj2) {
name = "Bob";
console.log(name, age);
}
}
  • ๐Ÿค” 9
  • ๐Ÿคฉ 7
  • ๐Ÿ‘ 5
  • โค 1
Post #1604 5.54K
  • ๐Ÿ”ฅ 13
  • ๐Ÿ‘ 7
  • ๐Ÿค” 4
  • โค 3
Post #1603 6.04K
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

โ“ CHALLENGE


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

let a = 10;
let b = 20;

with (obj) {
a += 1;
b += 1;
}

console.log(a, obj.a, b, obj.b);
  • ๐Ÿค” 11
  • ๐Ÿ‘ 3
  • โค 1
Post #1602 5.57K
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

๐ŸŒฒ Node.js Security release process

Only those who have been involved in a security release process know how hard it is (time-consuming, effort).
We've been working hard to automate most (if not all) of the process and the new security release process is live

Rafael Gonzaga
  • โค 4
  • ๐Ÿ‘ 3
  • ๐Ÿ”ฅ 2
Post #1600 6.33K
  • ๐Ÿ‘ 6
Post #1599 6.47K
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

โ“ CHALLENGE


const weakMap = new WeakMap();
const objs = [{}, {}, {}];

objs.forEach((obj, index) => weakMap.set(obj, index + 1));

const result = objs.filter(obj => weakMap.has(obj)).map(obj => weakMap.get(obj) * 2);

console.log(result);
  • ๐Ÿ‘ 6
  • โค 3
  • ๐Ÿ”ฅ 3
  • ๐Ÿค” 3
Post #1598 5.89K
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

๐Ÿ‘ Volta 2.0: Install and Run JavaScript Tools Quickly

A long-standing Rust powered tool for installing and switching JavaScript related tools (like Node, TypeScript, Yarn, etc.) โ€ฆ โ€œno matter the package manager, Node runtime, or OS.โ€ GitHub repo.

Volta
  • ๐Ÿ‘ 5
  • โค 2
  • ๐Ÿ”ฅ 2
Post #1597 5.86K
  • ๐Ÿ‘ 12
  • โค 6
  • ๐Ÿ”ฅ 3
  • ๐Ÿค” 1
Post #1596 6.23K
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

โ“ CHALLENGE


const weakMap = new WeakMap();
const obj1 = {};
const obj2 = { key: 'value' };

weakMap.set(obj1, obj2);

const result = weakMap.get(obj1).key.split('').reverse().join('');

console.log(result);
  • ๐Ÿ‘ 8
  • ๐Ÿค” 4
  • โค 2
Post #1595 6.01K
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

๐Ÿ˜† What about JavaScript?
  • ๐Ÿคฃ 46
  • โค 6
  • ๐Ÿ‘ 4
  • ๐Ÿ”ฅ 4
Post #1594 5.73K
  • ๐Ÿ‘ 10
  • โค 8
  • ๐Ÿ”ฅ 3
Post #1593 6.04K
Sponsored by Bryntum ๐Ÿ‘ฎโ€โ™€๏ธ
World Class Web Components

โ“ CHALLENGE


const weakMap = new WeakMap();
const array = [1, 2, 3];
const obj = {};

weakMap.set(obj, array);

const result = weakMap.get(obj).reduce((acc, val) => acc + val);

console.log(result);
  • ๐Ÿ‘ 7
  • โค 1
Post #1591 6.36K
  • ๐Ÿ‘ 1
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 โ†’