Looking at the console log it seems like the length of repeatLater is one plus the number of objects which is odd, the addition being proto. The JavaScript array findIndex () method returns the index of first element of the given array that satisfies the provided function condition. I suspect that the problem might be because there are objects/entries in the repeatLater array that do not have the âminTrialâ key. Occasionally I get thrown this error : TypeError: Cannot read property âminTrialâ of undefined The findIndex () method returns the index (position) of the first element that passes a test. repeatIdx = repeatLater.findIndex( x => x.minTrial <= trials.thisN ) The findIndex () method executes a function for each array element. After retrieving the trial, I delete that object from the array. ![]() If no element of the array satisfies the. ![]()
0 Comments
Leave a Reply. |