You can run your Javascript code online using this tool. It will show you realtime logs and error for your Javascript code as you write them in the editor. You can format your Javascript code using this tool and also embed the code tool in your website using embed link.
Paste or write your Javscript code in the editor and see realtime console logs and console errors in the right panel of the tool.
You can also save the Javascript code on the cloud using this tool and copy the link after saving the code. It will save your javascript script code and you can check the code any time by using specific link.