I have a `switch case`:

```
 var rollNumValue = "1001";
 switch (someVariable) {
     case 'A':
        urlKey = 'abc/api/01';
        keyField = { rollNo: rollNumValue};
     break;
     case 'B':
        urlKey = 'abc/api/02';
        keyField = { rollNo: rollNumValue};
     break;
     default:
        urlKey = 'abc/api/03';
        keyField = { serialNumber : rollNumValue};
 }

```

I want to convert it into a ternary condition so that I can reduce the number of lines of code. 

**Why?**

I have to store the code in the database.

**Edit**

```
default:
        urlKey = 'abc/api/03';
        keyField = { serialNumber : rollNumValue};
 }

```