3liYusuf / js-objects-lab

0 stars 0 forks source link

Think about using .find to make this more dynamic #3

Open KhalilKhunji opened 1 month ago

KhalilKhunji commented 1 month ago

https://github.com/3liYusuf/js-objects-lab/blob/27bc3d2301bd3029c9d81608b81de9a5647c6b91/app.js#L162

If the index of pokeballs changed, then this would no longer work. In some cases, you will need to make accessing arrays/objects more dynamic, and in this particular case, find would be useful (as you used it later in this lab).