JS Codewars - Pete the Baker Challenge