Which writing method is better judged by if?

which is better to write the following code:
method 1:

if(show){
    drawercStyle = {
        width: 100%
    }
    maskStyle = {
        opacity: 1
    }
}
else{
    drawercStyle = {
        width: 0
    }
    maskStyle = {
        opacity: 0
    }
}
Oct.11,2021

if I wrote it

  

Ternary operators do not need parentheses

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-1b3a77d-2c21d.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-1b3a77d-2c21d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?