Quote:
Originally Posted by cbk1994
The code you posted is wrong, actually. You'd need to do this (you forgot to take that index out of the array):
PHP Code:
temp.saleamount = temp.fish[temp.fish.index(fish) + 1];
My way is probably more efficient, however, since the engine isn't having to check through the array once to find the index, add one to the index, then loop through the array again to find the other index. However, it'd be such a miniscule difference it would work fine either way.
|
Oh, you're right haha. How dumb of me =p