Several popular online tools exist, here are some examples:
- JSFiddle
- CodeSandbox
- CodePen
- Replit
What are the main benefits to using browser-based sandbox tools?
Work in the browser without downloading any new programs.
Since we only require the browser, we can potentially work on different machines.
Cloud based tools tend to allow more than one user to work on a project at any one time.
Share your code with other people easily, since it's already online.
Large projects potentially require the use of local databases to test, which can be hosted with docker.
It's still possible to set up such a testing infrastructure for the cloud, but unsure how straightforward it is.
CodeSandbox even allows the installation of npm libraries so it would really just depend on your use case.
Local installations usually have the benefit of being more responsive.
But depending on your machine, you may be better off using a browser-based sandbox.