Always check your inputs, which are provided from outside, e.g. CLI args, HTTP requests,...
I also can recommend using TypeScript and get rid of JS.
Even for smaller projects, it's always helpful.
Use ESLint as a plugin for VSCode to get notified about code-smells, which potentially introduce security flaws.
Like one said here, Security topics are very generic and not specifically to a programming language.
You can have a look at OWASP.