const numbers = Array.from(new Array(15)).map(
  (elem,index)=>{return index + 1}
)

const fizzBuzzer = integer => {
    
  const dictionary = {
    15: "FizzBuzz",
    3: "Fizz",
    5: "Buzz"
  }
  const testers = Object.keys(dictionary).sort();

  const factor = testers.find(testNumber => integer % testNumber === 0);

  /* 
    This next line is object destructuring. It says: 
    * compute a property name from the variable "factor"
    * find that property in the 'dictionary' object
    * assign its value to the variable name 'result'. 
    * If that value is undefined, use the "integer" variable instead (as a default value)

    for more reading: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Computed_object_property_names_and_destructuring */
  
  let {[factor]:result = integer} = dictionary;
  
  return new String(result);
}

console.log(numbers.map(fizzBuzzer))

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.