async function asyncQuiz() {
console.log("Start");
const promise1 = new Promise((resolve) => {
setTimeout(() => resolve("Promise 1"), 1000);
});
const promise2 = new Promise((resolve) => {
setTimeout(() => resolve("Promise 2"), 500);
});
console.log(await promise1);
console.log(await promise2);
console.log("End");
}
asyncQuiz();
Please open Telegram to view this post
VIEW IN TELEGRAM
π€13π12 9β€8
What is the output?
Anonymous Quiz
45%
Start, Promise 1, Promise 2, End
36%
Start, Promise 2, Promise 1, End
10%
Start, Promise 1, End, Promise 2
9%
Start, Promise 2, End, Promise 1
π€20 10π9π€©2β€1
Please open Telegram to view this post
VIEW IN TELEGRAM
π€15π€£9β€5π4
function* gen() {
yield *[1,1];
yield 2;
yield 3;
}
const generator = gen();
console.log(generator.next().value);
console.log(generator.next().value);
for (const value of generator) {
console.log(value);
}
Please open Telegram to view this post
VIEW IN TELEGRAM
π14 7π€4β€3
π11 7β€2π€©1
Who doesnβt love a good front-end tool? In this roundup, youβll find useful front-end tools that were popular last year and will help you speed up your development workflow. Letβs dive in!
Louis
Please open Telegram to view this post
VIEW IN TELEGRAM
π12β€7 5π€©3
function getArr() {
return Array.from(arguments);
}
const result = getArr(...[1, 2, 3]);
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
π1
StringZilla v3 is starting to look serious! Crushing C++ standard library by 3-20x is one thing... But superseding LibC implementations and potentially bringing them to other programming languages is what will make this library truly specialπ₯
Any Rust and JS developers with C experience willing to implement the wrappers?
Ash Vardanian
Any Rust and JS developers with C experience willing to implement the wrappers?
Ash Vardanian
CHALLENGE
const string = 'a1b2c3d4e5';
const result = string.match(/\d+/g).map(Number);
console.log(result);
What is the output?
Anonymous Quiz
47%
[1, 2, 3, 4, 5]
28%
['1', '2', '3', '4', '5']
8%
[1, '2', 3, '4', 5]
18%
This will result in an error.
π14 4β€3
Mentorship is a process in which a more experienced or more knowledgeable person (a mentor) helps to guide a less experienced or less knowledgeable person (a mentee). Relatively little is known about the practice of mentorship within software development contexts. For that reason, we would like to ask you a few questions about what mentorship means to you and what matters most in mentoring relationships.
The survey is expected to take 10-15 minutes to complete. Only the researchers involved in this study will see your responses. Your participation in this study is voluntary. You also do not have to answer any question that makes you uncomfortable. Participants must be 18+. For questions or comments about the survey, please reach out to Dr. Reed Milewicz ([email protected]) or Dr. Alexander Serebrenik ([email protected]). Clicking submit indicates that you consent to the use of your survey response data in our study.
For every survey completed, we pledge to donate $1 USD to an open-source 501(c)(3) non-profit organization of your choice.
Link to the survey: https://snl-survey.sandia.gov/surveys/Telegram-Javascript-Mentorship-Survey
Please open Telegram to view this post
VIEW IN TELEGRAM
π6
Please open Telegram to view this post
VIEW IN TELEGRAM
π€£80π13π€©6 4π€2β€1
function* fibonacci() {
let a = 0, b = 1;
while (true) {
yield a;
[a, b] = [b, a + b];
}
}
const fibSequence = Array.from({ length: 5 }, () => fibonacci().next().value);
console.log(fibSequence);
Please open Telegram to view this post
VIEW IN TELEGRAM
π10π€5β€2
What is the output?
Anonymous Quiz
27%
[0, 0, 0, 0, 0]
41%
[0, 1, 1, 2, 3]
21%
[0, 1, 1, 3, 5]
11%
[0, 1, 2, 4, 8]
From Socket comes a look at the past year from the perspective of the npm registry, focused largely on statistics (2.5 million live packages!), including download numbers, popular packages, as well as some βquirky factsβ like the package with the most maintainers (554, if you're wondering.)
PHILIPP BURCKHARDT (SOCKET)
Please open Telegram to view this post
VIEW IN TELEGRAM
π6β€5 1
const matrix = [
[2, 4],
[6, 8],
];
const result = matrix.reduceRight((acc, row) => acc.concat(row.map(num => num * 2)), []);
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
β€9 4π3π€£3
What is the output?
Anonymous Quiz
51%
[4, 8, 12, 16]
16%
[8, 6, 4, 2]
23%
[12, 16, 4, 8]
10%
[2, 4, 6, 8]
π11π€10 8β€4π€£1
No dependencies, but 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.TINYLIBS
Please open Telegram to view this post
VIEW IN TELEGRAM
β€5π3 3
async function asyncArrayOperations() {
const array1 = [1, 2, 3];
const array2 = [4, 5, 6];
const result = await Promise.all([array1, array2].map(async arr => {
return await arr.reduce(async (acc, num) => {
return (await acc) + num;
}, Promise.resolve(0));
}));
console.log(result);
}
asyncArrayOperations();
Please open Telegram to view this post
VIEW IN TELEGRAM
β€8π2π₯1
What is the output?
Anonymous Quiz
14%
[10, 20]
36%
[1, 2, 3, 4, 5, 6]
40%
[6, 15]
10%
This will result in an error.
β€7 5π4