Closed whahuzhihao closed 8 years ago
Hi! I'm reading your code these days and got a doubt about some feature. In server.js deleteFood function, splice will change the whole array members' index. So in the forEach loop, some wrong foods will be removed. Am I right?
deleteFood
forEach
I made a mistake. The foodEaten's elements stand from high to low , so there's no problem with splice.
Hi! I'm reading your code these days and got a doubt about some feature. In server.js
deleteFood
function, splice will change the whole array members' index. So in theforEach
loop, some wrong foods will be removed. Am I right?