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
What is the output?
Anonymous Quiz
17%
10
49%
20
23%
undefined
11%
Error
👍9🔥7🤔32
Please open Telegram to view this post
VIEW IN TELEGRAM
👍43🔥1
CHALLENGE

const a = false || 0 || "" || null || "JavaScript";
console.log(a);
🔥5👍3
What is the output?
Anonymous Quiz
13%
null
25%
false
9%
""
54%
JavaScript
🤔23🔥12👍83
this was in 2017, and it was only for the landing page
🤣34👍62🤔2🤩2
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
What is the output?
Anonymous Quiz
32%
Not David
46%
David
16%
undefined
6%
Error
👍11🔥94🤣1
🌪 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
Please open Telegram to view this post
VIEW IN TELEGRAM
👍13🤔81
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
What is the output?
Anonymous Quiz
53%
120, 120
20%
120, undefined
12%
Error
15%
5, 5
🤔10👍7🔥61
🌲 Tinybench 3.0: A Tiny, Simple Benchmarking Library

Uses whatever precise timing capabilities are available (e.g. process.hrtime or peformance.now). You can then benchmark whatever functions you want, specify how long or how many times to benchmark for, and get a variety of stats in return. GitHub repo.

Tinylibs
Please open Telegram to view this post
VIEW IN TELEGRAM
👍72🔥2
CHALLENGE

const obj = { value: 10 };
const result = (obj.value += 5) && obj.value;
console.log(result);
👍2
What is the output?
Anonymous Quiz
7%
5
71%
15
12%
undefined
10%
Error
👍184🔥3
🫡 Faker 9.1: Generate Fake, Realistic Data on Demand

Names, bios, addresses, zip codes, dates, monetary amounts, transactions, and a lot more besides. I really like the guided DevTools console based demo you can try – an idea other projects should consider. GitHub repo.

Faker.js Team
Please open Telegram to view this post
VIEW IN TELEGRAM
👍7🔥42
CHALLENGE

async function test() {
return (await Promise.resolve(0)) || 10;
}

test().then(console.log);
👍11
What is the output?
Anonymous Quiz
25%
0
49%
10
17%
undefined
9%
Error
🤩9👍63
🤟 Why Code Security Matters - Even in Hardened Environments

A nicely diagrammed deep dive (and it really is deep) into a technique that allows malicious parties to turn a file write vulnerability in a Node app into a remote code execution exploit even when the file system is mounted read-only.

Stefan Schiller (Sonar)
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥42👍2🤔1
CHALLENGE

const arr = [1, 2, 3];
const copy = [...arr];
copy.push(4);

console.log(arr);
console.log(copy);
👍4
👍1510🔥9🤔1
Please open Telegram to view this post
VIEW IN TELEGRAM
👍83🔥2🤩1
CHALLENGE


console.log(typeof typeof 42);
Please open Telegram to view this post
VIEW IN TELEGRAM
👍5🔥32