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
899

Showing posts older than #1812 Β· Back to latest

Older Posts 20 shown
Post #1811 6.59K
CHALLENGE

const factorial = (function () {
const cache = {};
return function inner(n) {
if (n in cache) return cache[n];
return (cache[n] = n <= 1 ? 1 : n * inner(n - 1));
};
})();

console.log(factorial(5));
console.log(factorial(5));
  • πŸ€” 8
  • πŸ”₯ 5
  • πŸ‘ 4
Post #1810 6.94K
πŸŒͺ Python Jumps to #1 on GitHub Over JavaScript, But...

GitHub Universe took place this week, flooding us with data about how folks are using the platform. Of interest to those on social media was that Python has taken JavaScript's #1 language crown, though many argued that TypeScript (now #3) made an impact here. In positive news, JS still ranks first for code pushes alone and there's been a 15% jump in npm package consumption in the past year.

GitHub
  • πŸ‘ 13
  • πŸ€” 8
  • ❀ 1
Post #1809 6.03K
  • πŸ‘ 11
  • πŸ”₯ 9
  • ❀ 4
  • 🀣 1
Post #1808 6.44K
CHALLENGE

function Person(name) {
this.name = name;
this.sayName = () => console.log(this.name);
}

const person1 = new Person('David');
const person2 = { name: 'Not David', sayName: person1.sayName };

person2.sayName();
  • πŸ‘ 7
  • πŸ”₯ 1
Post #1807 6.73K
this was in 2017, and it was only for the landing page
  • 🀣 34
  • πŸ‘ 6
  • ❀ 2
  • πŸ€” 2
  • 🀩 2
Post #1806 6.05K
  • πŸ€” 23
  • πŸ”₯ 12
  • πŸ‘ 8
  • ❀ 3
Post #1805 6.39K
CHALLENGE

const a = false || 0 || "" || null || "JavaScript";
console.log(a);
  • πŸ”₯ 5
  • πŸ‘ 3
Post #1803 6.58K
  • πŸ‘ 9
  • πŸ”₯ 7
  • πŸ€” 3
  • ❀ 2
Post #1802 6.36K
CHALLENGE

const obj = { a: 10 };
console.log(obj.a && obj.b || 20);
  • πŸ‘ 2
  • ❀ 1
Post #1800 6.73K
  • πŸ‘ 8
  • ❀ 4
  • πŸ”₯ 4
Post #1799 6.39K
CHALLENGE

function memoize(fn) {
const cache = {};
return (arg) => cache[arg] ?? (cache[arg] = fn(arg));
}

const square = memoize((n) => n * n);

console.log(square(5));
console.log(square(5));
console.log(square(6));
  • πŸ‘ 6
  • πŸ”₯ 1
Post #1798 6.98K
🀟 Transformers.js v3: Now You Can Run Transformers in Node.js

A JavaScript port of Hugging Face’s transformers Python library that makes it possible to run natural language, vision, and audio machine learning models. v3 adds WebGPU support and now supports Node (plus Deno and Bun) as well as the browser. 1200+ models are ready to run in areas like embeddings, text generation, and speech recognition (as with whisper-small).

Hugging Face
  • ❀ 9
  • πŸ‘ 5
  • πŸ”₯ 4
Post #1797 5.88K
  • πŸ‘ 15
  • ❀ 4
  • πŸ”₯ 2
  • πŸ€” 2
Post #1796 6.21K
CHALLENGE

console.log('A');

setTimeout(() => console.log('B'), 0);

Promise.resolve()
.then(() => {
console.log('C');
return Promise.resolve();
})
.then(() => console.log('D'));

console.log('E');
  • ❀ 1
  • πŸ‘ 1
Post #1795 6.66K
πŸ‘€ A neat way to find and tidy unused stuff in your projects

Knip finds unused files, dependencies and exports in your JavaScript and TypeScript projects. Less code and dependencies lead to improved performance, less maintenance and easier refactorings.

webpro-nl
  • πŸ‘ 5
  • ❀ 3
  • πŸ”₯ 2
  • πŸ€” 1
Post #1794 6.08K
  • πŸ”₯ 10
  • πŸ‘ 4
  • 🀣 4
  • ❀ 3
Post #1793 6.05K
CHALLENGE

console.log(typeof null);
console.log(typeof function () {});
Post #1791 6.79K
🟠 Svelte 5 is Alive

The long awaited next major release of Svelte, the compiler-driven JS UI framework, is the β€œmost significant release in the project’s history”, while remaining largely backwards compatible. A big addition is runes for explicitly declaring reactive state, but there’s much more besides. The official svelte.dev site has also undergone a big rebuild to act as an β€˜omnisite’ for all things Svelte.

The Svelte Team
  • πŸ‘ 8
  • ❀ 3
  • πŸ”₯ 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 β†’