When JQ defines css, can the key name use a variable?

if...{
    a="left";
}else{
    a="right";
}

obj.css({
    a:"20px"
})

as above, the above practice does not work, is there any way to make this an a variable?
because of the complexity of the situation, you have to do this, which can save you a lot of trouble. Does anyone know this can be achieved?

Mar.21,2022

you can write this directly in high-version browsers

obj.css({
  [a]: '20px',
});

if you are writing a production page directly for compatibility, you should write

like this.
var style = {};
style[a] = '20px';
obj.css(style);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7bb852-1f274.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7bb852-1f274.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?