JavaScript
32.1K subscribers
1.06K photos
10 videos
33 files
734 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 #205


function asyncFunction(value) {
return new Promise(resolve => {
setTimeout(() => {
console.log(value);
resolve(value);
}, 1000);
});
}

(async () => {
const results = await Promise.all([asyncFunction(1), asyncFunction(2), asyncFunction(3)]);
console.log(results);
})();
Please open Telegram to view this post
VIEW IN TELEGRAM
👍14
🔥9🤔6👍42
☠️
Please open Telegram to view this post
VIEW IN TELEGRAM
🤔23🤣203👍1🤩1
CHALLENGE #206


for (var i = 0; i < 3; i++) {
const log = () => {
console.log(i)
}
setTimeout(log, 100)
}
Please open Telegram to view this post
VIEW IN TELEGRAM
👍6🔥21
What is the output?
Anonymous Quiz
28%
Error
37%
1, 2, 3
6%
3, 2, 1
29%
3, 3, 3
🤣21🔥8🤔64👍2
🤔
Please open Telegram to view this post
VIEW IN TELEGRAM
🤣46🤔62🔥2👍1
CHALLENGE #207


var a = 1
function output () {
console.log(a)
var a = 2
console.log(a)
}
console.log(a)
output()
console.log(a)
Please open Telegram to view this post
VIEW IN TELEGRAM
🤣15👍61🔥1
What is the output?
Anonymous Quiz
13%
2, 1
20%
2, 2
23%
1, 1
45%
1, 2
🤔399🤣7🤩2👍1🔥1
👩‍💻 Angular 17 - New Build-In Control Flow Overview

Angular 17 was released last week and a significant enhancement was support for a new syntax in templates that looks and feels more JavaScript-y.

DMYTRO MEZHENSKYI
Please open Telegram to view this post
VIEW IN TELEGRAM
5👍3🔥2
CHALLENGE #208


const asyncFunction = async () => {
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));

const result = await Promise.race([delay(100), delay(500)]);
return result;
};

asyncFunction().then(value => console.log(value));
Please open Telegram to view this post
VIEW IN TELEGRAM
👍95🔥2🤔2
What is the output?
Anonymous Quiz
25%
500
36%
100
34%
undefined
5%
Error
2🤔1
Hey awesome community members! 🎉

Guess what? Our favorite programming language, JavaScript, just turned 28 on December 4th! 🎂🥳

Can you believe it's been powering the web for nearly three decades now?

Let's take a moment to appreciate the incredible journey of innovation and transformation it has brought to the world of coding. 🚀

Happy Birthday JavaScript
Please open Telegram to view this post
VIEW IN TELEGRAM
35🔥8🤩4👍2
CHALLENGE #209


function* fibonacci() {
let [prev, curr] = [0, 1];
while (true) {
[prev, curr] = [curr, prev + curr];
yield curr;
}
}

const fib = fibonacci();

console.log(fib.next().value);
console.log(fib.next().value);
console.log(fib.next().value);
Please open Telegram to view this post
VIEW IN TELEGRAM
👍4
What is the output?
Anonymous Quiz
25%
1, 1, 2
17%
2, 3, 5
35%
1, 2, 3
22%
0, 1, 1
👍9🔥4🤔21
They are just jealous 🥲
Please open Telegram to view this post
VIEW IN TELEGRAM
🤣50👍43🤩1
CHALLENGE #210


function deepFreeze(obj) {
Object.freeze(obj);
Object.getOwnPropertyNames(obj).forEach(prop => {
if (typeof obj[prop] === 'object' && !Object.isFrozen(obj[prop])) {
deepFreeze(obj[prop]);
}
});
return obj;
}

const data = { a: { b: { c: 1 } } };
const frozenData = deepFreeze(data);

frozenData.a.b.c = 2;

console.log(frozenData.a.b.c);
Please open Telegram to view this post
VIEW IN TELEGRAM
👍94
What is the output?
Anonymous Quiz
27%
1
29%
2
32%
undefined
12%
Error
🤔156👍4🔥2🤩1
😮 Node.js Download Statistics

Node.js TSC member Matteo has put together a handy site that visualizes the publicly available Node.js download statistics, partly as a way to help guide you as to which versions and which architectures need the most support. Notably, Node 18 has only just begun to pass Node 16 in popularity..

MATTEO COLLINA
Please open Telegram to view this post
VIEW IN TELEGRAM
6🔥4👍1
CHALLENGE #211


const obj = {};
const sym1 = Symbol('a');
const sym2 = Symbol('b');

obj[sym1] = 1;
obj[sym2] = 2;

console.log(Object.keys(obj));
Please open Telegram to view this post
VIEW IN TELEGRAM
👍2
🤔15👍104🤣4🔥3