JS2: Attendance and activity¶
Stack Overflow Statistics¶
What is the difference between for..in and for..of?
Do you know what spread operator (…) does? (not course content, but good to know)
const arr1 = [1, 2, 3]; const obj1 = {a: 1, b: 2, c: 3}; const arr2 = [...arr1]; const obj2 = {...obj1};
What happens here:
let arr = [[]];
How about here:
table_row += "</tr>";
What is the operation (+=) called?
Manipulating StackOverflow data¶
What is the difference between ++counter and counter++?
Please explain what happens here:
let year = 2020; let yearlyTechStats = {}; const yearlyTechs = Object.keys(stackOverflowStats[year]); for (const tech of yearlyTechs) { if (tech.startsWith("current")) { yearlyTechStats = {...yearlyTechStats, ...stackOverflowStats[year][tech]}; } }
How about here:
let html = ''; for (const row of rowData) { html += `<tr><td>${row.join('</td><td>')}</td></tr>`; }
Can there be many theads in a table - how about many tbodies?