Em Quotes Test

by rexonms

JavaScript

let quotes = [
{ quote: "Life is too short for long-term grudges.", type: "short"  },
        { quote: "When something is important enough, you do it even if the odds are not in your favor.", type: "medium"},
        { quote: "I think it's very important to have a feedback loop, where you're constantly thinking about what you've done and how you could be doing it better. I think that's the single best piece of advice: constantly think about how you could be doing things better and questioning yourself.", type: "long"},
        { quote: "Life is too short for long-term grudges.",  type: "short"   },
        { quote: "When something is important enough, you do it even if the odds are not in your favor."},
        { quote: "I think it's very important to have a feedback loop, where you're constantly thinking about what you've done and how you could be doing it better. I think that's the single best piece of advice: constantly think about how you could be doing things better and questioning yourself."},
        { quote: "Life is too short for long-term grudges." },
        { quote: "When something is important enough, you do it even if the odds are not in your favor.",  type: "short" },
        { quote: "I think it's very important to have a feedback loop, where you're constantly thinking about what you've done and how you could be doing it better. I think that's the single best piece of advice: constantly think about how you could be doing things better and questioning yourself."},

]

function getQuotesByType(type) {
   let newQuotes = quotes.map( quote => {
      if(quote.type == type ) {
          console.log(quote)
      }
   })
}
getQuotesByType('short')