Using range() in Underscore I can make something like this:
_.range(10);
>> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Can I somehow modify/use that to create a result such as this:
solution();
>> {0: true, 1: true, 2: true, 3: true}
The solution may also include jQuery.
Yes.
jsFiddle.
If you must have an object (the former returns an array), run this on the result…
jsFiddle.
It’s worth mentioning, if you didn’t have Underscore or wanted to use jQuery, there are equivalents
$.map()and$.extend().