Is there a way to set a indent size just for a specific language?

javascript

#1

I want the indent size of the code editor to be automatically set to 2 spaces for JavaScript files, and 4 spaces for every other language. Is there a way to do this?