6

I find myself typing JavaScript in the console a lot. For example, I quickly want to see the result if I change the property of a certain object. However every time that I refresh the page I have to redefine my variables, etc. I do this by using the up-key, so I do not have to retype, but this costs a lot of time. What is a better way?

The ultimate coolness would be an environment like Sublime Text in which you can write multi line code and from there execute it directly in the browser... And then still have the autocomplete list of all the methods of an object (like in the console). Obviously this is not available, but I am very interesting in the workflow of other when typing JavaScript code in the console.

2
  • Do you Shift+Enter make a new line without submitting your code? Commented Oct 17, 2012 at 19:37
  • Yeah sometimes but I don't like it to much. Because I somehow cannot work as fast as I would like to. Commented Oct 23, 2012 at 14:53

1 Answer 1

15

In Chrome 24's Sources panel, use the Snippets tab. Right-click in the left (blank) tree and choose New from the context menu.

Sign up to request clarification or add additional context in comments.

1 Comment

This is a nice feature. You don't have the object methods completion within the "snippet panel" though. Therefor you still have to use the console. But it is definitely useful. Thanks.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.