Functional Programming, JavaScript.
at how we can improve our sample problem: function findMonthName(months, mo) { if (months[mo - 1] !== undefined) { return Optional.of(months[mo - 1]); } else { return Optional.empty(); } } This allows you to be more idiomatic about how you handle failures. Your calling code looks like: