DEV Community

Discussion on: Type | Treat Challenge 2

Collapse
 
clandau profile image
Courtney

"The need to use [number] is an interesting twist, because [0] or 1 would have worked just as well too. Doing this right would also have raised the typo in the original code."

I'm confused by the wording here. So, number AND [0] or [1] would work? So, you don't actually have to use number?

Collapse
 
orta profile image
Orta

Yeah, you can use number or any literal like 1, 2, etc.

In this case, number however feels more right, because you're saying any number from the index, not a specific one.

Collapse
 
clandau profile image
Courtney

Thanks! That makes sense.