I'm given a number. I need to create an array that contains 4 numbers below it, the number itself and then 4 numbers above it.
My naive approach was to create 2 for loops, but I feel like there's a more efficient way to do this using some ES6 syntax.
For example:
generateArray(240) // [236, 237, 238, 239, 240, 241, 242, 243, 244 ];