It is more reasonable to write a ternary expression when it is judged to be true and does not change.

for example:

getCookie ("home_voice")? True: setCookie ("home_voice", 0);

it feels strange to true. Do you have a more suitable one? Do not know whether it is feasible to give an empty string ("")?

Oct.28,2021

getCookie ("home_voice") | | setCookie ("home_voice", 0)


empty string does not work, because judging by if, empty string returns false


just use or

getCookie("home_voice") || setCookie("home_voice",0);

getCookie("home_voice")getCookie("home_voice"):setCookie("home_voice",0);

then why do you still use three yuan? If the upstairs positive solution
is really executed, then use getCookie ("home_voice") & & setCookie ("home_voice", 0)
if it is not true, use getCookie ("home_voice") | | setCookie ("home_voice", 0)
if you still want to use
getCookie ("home_voice")? Console.log ("getCookie (" home_voice ") = true"): setCookie ("home_voice", 0);
easy to debug

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