Skip the Drinks with Too Much Sugar

Published by meesie1 in

Write a function that takes an array of drinks and returns an array of only drinks with no sugar in them. Drinks that contain sugar (in this challenge) are:

  • cola
  • fanta

Examples

skipTooMuchSugarDrinks(["fanta", "cola", "water"]) ➞ ["water"]

skipTooMuchSugarDrinks(["fanta", "cola"]) ➞ []

skipTooMuchSugarDrinks(["lemonade", "beer", "water"]) ➞ ["lemonade", "beer", "water"]

Notes

  • The function returns an array of strings.
  • All drink names are in lowercase.
Watch a quick demo on how Edabit works.