👍9🔥7🤔3❤2
Please open Telegram to view this post
VIEW IN TELEGRAM
👍4❤3🔥1
CHALLENGE
const a = false || 0 || "" || null || "JavaScript";
console.log(a);
🔥5👍3
🤔23🔥12👍8❤3
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
👍11🔥9❤4🤣1
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🤔8❤1
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
🤔10👍7🔥6❤1
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
👍7❤2🔥2
CHALLENGE
const obj = { value: 10 };
const result = (obj.value += 5) && obj.value;
console.log(result);
👍2
👍18❤4🔥3
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🔥4❤2
CHALLENGE
async function test() {
return (await Promise.resolve(0)) || 10;
}
test().then(console.log);
👍11
🤩9👍6❤3
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
🔥4❤2👍2🤔1
CHALLENGE
const arr = [1, 2, 3];
const copy = [...arr];
copy.push(4);
console.log(arr);
console.log(copy);
👍4
What is the output?
Anonymous Quiz
8%
[1, 2, 3, 4], Error
11%
[1, 2, 3], Error
21%
[1, 2, 3, 4], [1, 2, 3, 4]
60%
[1, 2, 3], [1, 2, 3, 4]
👍15❤10🔥9🤔1
Please open Telegram to view this post
VIEW IN TELEGRAM
👍8❤3🔥2🤩1
CHALLENGE ❓
console.log(typeof typeof 42);
Please open Telegram to view this post
VIEW IN TELEGRAM
👍5🔥3❤2