How can I stop the debugger from closing immediately? (JS in VS2022)

I’m learning Javascript and using Visual Studio 2022 to run my program. I’ve used VS2022 for C++, but never for Javascript. Unlike for C++, the debugger for JS closes immediately after finishing. How can I prevent that from happening? I need to be able to see my console.log() statements being printed.

I’ve been putting a console.log() statement at the end with a breakpoint, which worked, but I’m hoping there’s a cleaner solution.