Extremely Over-Nested

Published by Matt in

Create a function that returns the original value from an array with too many sub-arrays.

Examples

de_nest([[[[[[[[[[[[3]]]]]]]]]]]]) ➞ 3

de_nest([[[[[[[true]]]]]]]) ➞ true

de_nest([[[[[[[[[[[[[[[[["edabit"]]]]]]]]]]]]]]]]]) ➞ "edabit"

Notes

You only need to retrieve one element.

Watch a quick demo on how Edabit works.