Hello, checkiomates🐱👤!
This week, we navigate a trademark debate over the name JavaScript, explore the controversial decision to move off TypeScript, and discover new, safer array methods. Our mission challenges you to synchronize magic capsules to calculate how many days it takes to reach a gold goal.
💡TIP
On Easy difficulty, each of the few starting stations is dedicated to a distinct data type. If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!
🏁MISSION
Magic Capsules by freeman_lex -
Fan Chi'ih has brought magic capsules from China, each with a specific production cycle that produces a gold coin on the last day of the cycle. By activating all the capsules simultaneously, he wants to know how many days it takes to accumulate at least exact number of gold coins. You are given a needed number of gold goal and a sequence of capsules' cycles.
assert.strictEqual(numDays(12, [3, 7, 2]), 14); assert.strictEqual(numDays(100, [17, 13, 20, 10, 12, 16, 10, 13, 13, 10]), 130); assert.strictEqual(numDays(20, [1, 2, 3, 4, 5]), 10);
📖ARTICLES
Help Us Raise $200k to Free JavaScript from Oracle -
The term JavaScript(™) is actually an Oracle trademark, but Ryan Dahl and Deno are attempting to fight that and are raising funds to get through the all-important discovery phase of the cancellation petition.
An interesting tale from an engineering team that has decided to throw in the towel on its 2.5 million lines of TypeScript, instead migrating to .NET and C#. React will remain on their frontend, however.
Finally, safe array methods in JavaScript -
In the last couple of years, we’ve gotten new array methods that make working with arrays safer and cleaner by avoiding mutation altogether
👩💻CODE SHOT
What do you think the following code does?
function checkio(
rows: number,
cols: number,
start: number = 1
): number[][] {
const result = [];
for(let r = 0; r < rows; r++){
const t = new Array(cols);
t.fill(0).forEach((e, i, a) => a[i] = start++);
result.push(r % 2 ? t.reverse() : t);
}
return result;
}
🙌 Thanks for your attention! Hope to meet you at CheckiO, as well as at our Instagram and Twitter! We are really interested in your thoughts! Please, leave a comment below! ⤵
