~jshholland/nexton6music

e8a3b9b644f0f32aea0864bb86e0dd727adee283 — Josh Holland 1 year, 1 month ago b12c64c master
use Array.map to save a bunch of repetition
1 files changed, 34 insertions(+), 34 deletions(-)

M index.html
M index.html => index.html +34 -34
@@ 37,11 37,11 @@ const makeIntro = (text, {needsN}={}) => {
  return { text, needsN };
};
const intros = [
  makeIntro("Next on BBC Radio 6 Music, a"),
  makeIntro("And now, time for a"),
  makeIntro("I can't stop listening to this"),
  makeIntro("Here's the latest track from my favourite"),
];
  "Next on BBC Radio 6 Music, a",
  "And now, time for a",
  "I can't stop listening to this",
  "Here's the latest track from my favourite",
].map(makeIntro);
const makeAdjective = (text, {hasVowel}={}) => {
  if (hasVowel === undefined) {
    hasVowel = "aeiouAEIOU".indexOf(text[0]) !== -1;


@@ 49,35 49,35 @@ const makeAdjective = (text, {hasVowel}={}) => {
  return { text, hasVowel };
};
const adjectives = [
  makeAdjective("a cappella"),
  makeAdjective("all-female"),
  makeAdjective("ambient"),
  makeAdjective("anarchist"),
  makeAdjective("Botswanan"),
  makeAdjective("Brighton-based"),
  makeAdjective("contemporary"),
  makeAdjective("Ecuadorean"),
  makeAdjective("Fijian"),
  makeAdjective("Finnish"),
  makeAdjective("Hungarian"),
  makeAdjective("Icelandic"),
  makeAdjective("Indonesian"),
  makeAdjective("instrumental"),
  makeAdjective("Latvian"),
  makeAdjective("Lithuanian"),
  makeAdjective("Macedonian"),
  makeAdjective("Nepali"),
  makeAdjective("Norwegian-American"),
  makeAdjective("Peruvian"),
  makeAdjective("Siberian"),
  makeAdjective("Tibetan"),
  makeAdjective("Transylvanian"),
  makeAdjective("Tuareg"),
  makeAdjective("underground"),
  makeAdjective("unsigned"),
  makeAdjective("up and coming"),
  makeAdjective("vegan"),
];
  "a cappella",
  "all-female",
  "ambient",
  "anarchist",
  "Botswanan",
  "Brighton-based",
  "contemporary",
  "Ecuadorean",
  "Fijian",
  "Finnish",
  "Hungarian",
  "Icelandic",
  "Indonesian",
  "instrumental",
  "Latvian",
  "Lithuanian",
  "Macedonian",
  "Nepali",
  "Norwegian-American",
  "Peruvian",
  "Siberian",
  "Tibetan",
  "Transylvanian",
  "Tuareg",
  "underground",
  "unsigned",
  "up and coming",
  "vegan",
].map(makeAdjective);
const genres = [
  "acid jazz",
  "dance-punk",