Skip to content

Instantly share code, notes, and snippets.

@NaitoKenzo
Created April 28, 2016 08:54
Show Gist options
  • Save NaitoKenzo/e52adda747d49b52c592aae890fad8b4 to your computer and use it in GitHub Desktop.
Save NaitoKenzo/e52adda747d49b52c592aae890fad8b4 to your computer and use it in GitHub Desktop.
Coding Battle
// Part of Q5
function Component (el) {
this.el = el
this.el.addEventListener(‘click’, () => {
this.logClick()
})
}
let total = () => {
square(2) * add(3, 4);
}
function functionName(tagMap) {
return Object.keys(tagMap).reduce(function (acc, product) {
return acc.concat(tagMap[product]);
}, []);
}
// Q2
function poules(team) {
var answer = [];
for (var i = 0; i < 4; i++) {
var poule = [];
for (var j = 0; j < 5; j++) {
var rand = Math.floor(Math.random() * team.length);
poule.push(team[rand]);
team.splice(rand, 1);
}
answer.push(poule);
}
return answer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment