JavaScript
32K subscribers
1.02K photos
9 videos
33 files
705 links
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
Download Telegram
CHALLENGE

async function test() {
console.log(1);
await new Promise(resolve => setTimeout(resolve, 1000));
console.log(2);
return 3;
}

console.log(4);
test().then(console.log);
console.log(5);
πŸ‘3πŸ”₯1
πŸ‘13πŸ”₯5🀣4❀3
πŸ˜‰ Build a Sonic Infinite Runner Game Using Kaplay

A two hour walkthrough of using the Kaplay game library (formerly known as Kaboom.js) to build a complete, if simple, Sonic-branded game. You can also play it here.

JSLegendDev
Please open Telegram to view this post
VIEW IN TELEGRAM
1πŸ‘10❀3πŸ”₯3
CHALLENGE

function Animal(name) {
this.name = name;
}
Animal.prototype.sound = 'Generic sound';

const dog = new Animal('Dog');

Animal.prototype.sound = 'Bark';
console.log(dog.sound);
πŸ‘3
What is the output?
Anonymous Quiz
17%
Undefined
10%
Error
53%
Bark
20%
Generic sound
🀣14πŸ‘10❀4🀩2
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯12πŸ‘4❀1
CHALLENGE

const obj = {
value: 10,
getValue: function () {
return () => this.value;
}
};

const value = 20;
const getValue = obj.getValue();
console.log(getValue());
πŸ‘3πŸ”₯3
What is the output?
Anonymous Quiz
45%
10
31%
20
18%
undefined
6%
Error
πŸ”₯15πŸ‘5❀2
🟠 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
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘8❀3πŸ”₯2
CHALLENGE

console.log(typeof null);
console.log(typeof function () {});
1πŸ”₯10πŸ‘4🀣4❀3
πŸ‘€ 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
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘5❀3πŸ”₯2πŸ€”1
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
πŸ‘15❀4πŸ”₯2πŸ€”2
🀟 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
Please open Telegram to view this post
VIEW IN TELEGRAM
❀9πŸ‘5πŸ”₯4
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
πŸ‘8❀4πŸ”₯4
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯7πŸ‘3❀2
CHALLENGE

const obj = { a: 10 };
console.log(obj.a && obj.b || 20);
πŸ‘2
What is the output?
Anonymous Quiz
17%
10
49%
20
23%
undefined
11%
Error
πŸ‘9πŸ”₯7πŸ€”3❀2
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘4❀3πŸ”₯1