a micro javascript sandbox to play around in
Make a new bookmark, then copy and paste this as the URL:
data:text/html,<html contenteditable onkeyup="try{this.style.color='rgb(240,239,208)';console.clear();eval(this.innerText);}catch(err){this.style.color='rgb(223,175,143)';console.log(err);}"><title>js_pad</title><style>html{background:rgb(63,63,63);color:rgb(240,239,208);font-size:1.5em;font-family:Monospace}</style></html>
uses contenteditable to make the root html element edittable. On every keypress it evals the page's content. Changes the text color if it's valid code or not. Open dev tools and use console.log to see the results for your code.
data:text/html,<html contenteditable onkeyup="try{
this.style.color='rgb(240,239,208)';
console.clear();
eval(this.innerText);
}catch(err){
this.style.color='rgb(223,175,143)';
console.log(err);
}">
<title>js_pad</title>
<style>
html{
background:rgb(63,63,63);
color:rgb(240,239,208);
font-size:1.5em;
font-family:Monospace
}
</style>
</html>