I have a string representation of a numerical range
var range = '6-14';
I want to create an array of integers represented by this range
[6,7,8,9,10,11,12,13,14]
I could implement this simple enough as a for
loop but that seems like a clunky, brute force method. Can this be done in a short or more elegant way?