You may already know this, but if not, learning to debug your code in VSCode is a game changer.
Being able to see what each value is doing while your code is running, being able to step through that code and see what the problem is, is an essential tool as a developer.
I created a very short video demonstrating how to do this in VSCode.
If you don't already use the feature, then give it a watch. Hope it helps out.