← Back to challenges

Album in Albumns

JavaScriptHarddata_structureslanguage_fundamentals

Instructions

You have an object with years 2015-2020 as keys and some albums released for each year as key values. Write a function that takes an album and returns the year in which it was released.

Examples

releaseYear("Ode to Joy") ➞ 2019

releaseYear("Honeymoon") ➞ 2015

releaseYear("Fake_album") ➞ "Unknown"

Note

  • Albums object is made for you.
  • If the album isn't in the object, return the string "Unknown".
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.