Unions and Indexing 10 exercises
Problem

Create Unions out of Array Valuesself.__wrap_balancer=(t,e,n)=>{n=n||document.querySelector(`[data-br="\${t}"]`);let o=n.parentElement,r=E=>n.style.maxWidth=E+"px";n.style.maxWidth="";let i=o.clientWidth,s=o.clientHeight,c=i/2,u=i,d;if(i){for(;c+1<u;)d=~~((c+u)/2),r(d),o.clientHeight==s?u=d:c=d;r(u*e+i*(1-e))}};self.__wrap_balancer(":Rhd9j6:",1)

const fruits = ["apple", "banana", "orange"]

Seeing this suggests that we're going to want the values of the array, so think about that.

Challenge

Your challenge is to get a union of AppleOrBanana, as well as creating a union ou

Transcript

0:00 In this exercise, we have an array of fruits here. Currently they're typed as just an array of strings.

0:08 We know that we're probably going to want the values of that array, so have a little think about that. We also want to say AppleOrBanana equals unknown. We want to get a union of apple or banana in that slot.

0:21 Otherwise, we want to take all of the values of the array and put them inside Fruit. That's your challenge.