CHALLENGE
function trickyArgs(a, b, c) {
arguments[0] = 10;
arguments[1] = 20;
arguments[2] = 30;
console.log(a + b + c);
}
trickyArgs(1, 2, 3);
๐ค18๐7โค1
๐ค37๐คฃ17๐11โค3๐ฅ2
Provides move generation, validation, piece placement, check/checkmate/stalemate detection โ "everything but the AI!" v1.0 offers a rewrite to TypeScript and a variety of enhancements.
Jeff Hlywa
Please open Telegram to view this post
VIEW IN TELEGRAM
๐8โค5๐ฅ1
CHALLENGE
function* numberGenerator() {
for (let i = 0; i < 3; i++) {
yield i * 2;
}
}
const numbers = [...numberGenerator()];
console.log(numbers);
๐1
๐20๐คฃ7โค3๐ฅ3
In order to feel more confident about my tsconfig.json, I decided to go through the tsconfig.json documentation, collect all commonly used options and describe them below...
Axel Rauschmayer
Please open Telegram to view this post
VIEW IN TELEGRAM
โค5๐5๐ฅ4
CHALLENGE
function getNextWeekday(dateString) {
const date = new Date(dateString);
const day = date.getDay();
const diff = (day === 0 ? 1 : 8) - day;
date.setDate(date.getDate() + diff);
return date.toDateString();
}
console.log(getNextWeekday('2023-10-20'));
โค13๐3๐ฅ3๐ค2๐คฉ1
What is the output?
Anonymous Quiz
31%
'Mon Oct 23 2023'
37%
'Fri Oct 20 2023'
24%
'Sat Oct 21 2023'
8%
'Sun Oct 22 2023'
๐ค27๐7โค5๐ฅ1๐คฉ1
CHALLENGE
var obj = {
a: 10,
b: 20
};
with (obj) {
var result = a + b;
}
console.log(result);
๐ฅ6๐2๐ค2
๐ค16๐12๐คฃ8โค3
Now almost 12 years old, NodeBB continues to offer a classic forum experience in a modern Node.js-shaped guise. The big update for v4 is support for federation between NodeBB instances and the wider fediverse generally. Note that the open source project (repo) is GPL licensed with NodeBB Inc providing a hosted service.
NodeBB, Inc.
Please open Telegram to view this post
VIEW IN TELEGRAM
๐7โค2๐ฅ1
CHALLENGE
const numbers = [2, 4, 6, 8, 10];
const allEven = numbers.every(function(num) {
return num % 2 === 0;
});
console.log(allEven);
๐11โค2
๐ฅ16๐5๐ค2
An easy-to-deploy solution for schema validation that can infer TypeScript definitions 1:1 and use them as optimized validators for your data, both at runtime and for immediate type-level feedback in your editor.
ArkType
Please open Telegram to view this post
VIEW IN TELEGRAM
๐9
CHALLENGE
const numbers = [10, 23, 45, 60, 78];
const isDivisibleByFive = numbers.some(num => num % 5 === 0);
if (isDivisibleByFive) {
console.log('Some numbers are divisible by 5');
} else {
console.log('No numbers are divisible by 5');
}
๐11
What is the output?
Anonymous Quiz
19%
No numbers are divisible by 5
7%
Error: num is not defined
6%
Undefined
68%
Some numbers are divisible by 5
๐21โค3๐ค3๐ฅ2๐คฃ2
Please open Telegram to view this post
VIEW IN TELEGRAM
๐11โค3๐ค3๐ฅ2๐คฉ1
Please open Telegram to view this post
VIEW IN TELEGRAM
๐คฃ111๐8๐ค3๐ฅ2โค1
CHALLENGE
const students = [
{ name: 'Alice', age: 20 },
{ name: 'Bob', age: 22 },
{ name: 'Charlie', age: 23 }
];
const studentToFind = { name: 'Bob', age: 22 };
const isIncluded = students.includes(studentToFind);
console.log(isIncluded);
๐10โค1
๐ค27๐20๐ฅ5โค4๐คฃ2