How to evaluate variable values and test my Obsidian plugin (written in typescript)?

Newbie here working on my first plugin. I’ve been struggling to convert between dates and strings and am stuck because I can’t figure out how to check the values of my variables.

My current “solution” is to just add Notices to check the strings and then copy the main.js and manifest.json to the Obsidian plugins folder and running the plugin. This is cumbersome, and since Notices only take strings I can’t check any date values.

Is there a way to view the values of my variables and to test the plugin as a whole without running the plugin in Obsidian and being limited to Notices?

To debug the variables values in obsidian go to View > Toggle Developer Tools

That lets you pause the code execution at any line you want with breakpoints and inspect the variable values:

Here’s the documentation for using the developer tools: Chrome DevTools - Chrome Developers

To avoid having to copy/paste the main.js you can move the files you’re working on into the obsidian plugin folder directly. Then with the sample plugin template run npm run dev to automatically regenerate main.js whenever any code changes (obsidian-sample-plugin/package.json at master · obsidianmd/obsidian-sample-plugin · GitHub)