What do curly braces in JavaScript mean?

In your case it is an object passed to your css function.

myObj={} // a blank object

Here you can use this too

myObj={'float' : 'right'}
xxx.css(myObj);

Here is another example of object

var myObj={
    'varOne':'One',
    'methodOne':function(){ alert('methodOne has been called!')}        
}
myObj.methodOne();​ // It will alert 'methodOne has been called!'

A fiddle is here.


The curly braces in the code you've shown define an object literal


This is the top search engine result for "javascript braces". As such it's worth mentioning that braces in JavaScript can be used for:

  • An object literal (as in the original question)
  • A code block
  • Object destructuring