Fixed formatting problems
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
const voted = {};
|
||||
const checkVoter = (name) => {
|
||||
|
||||
/**
|
||||
* Vote check
|
||||
* @param {string} name Voter name
|
||||
*/
|
||||
const checkVoter = name => {
|
||||
if (voted[name]) {
|
||||
console.log('kick them out!');
|
||||
console.log("kick them out!");
|
||||
} else {
|
||||
voted[name] = true;
|
||||
console.log('let them vote!');
|
||||
console.log("let them vote!");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
checkVoter('tom'); // let them vote!
|
||||
checkVoter('mike'); // let them vote!
|
||||
checkVoter('mike'); // kick them out!
|
||||
checkVoter("tom"); // let them vote!
|
||||
checkVoter("mike"); // let them vote!
|
||||
checkVoter("mike"); // kick them out!
|
||||
|
||||
Reference in New Issue
Block a user