In nodejs, the array.find function is called, which returns -1, and does not jump into the find function, but the same code can get parameters in the browser, and my node is
The code I used in vscode and vscode executed a random code and interrupted the input.
I think this is not related to the code, I copy the file to the students, run, return the result is the same as on the MDN, and I can not, he said that he had encountered this problem, may be related to the node version, but I used Vue to write components, also used to find, use positiveChang, so I don’t know what is happening to me. Is anyone experiencing the same problem?
I used the findIndex method directly
If I can’t find a qualified one, find should return to undefined. I don’t know what the reason is without code.
It’s not return c===2; is it?