我将数组放在外部js文件中。我不知道我该怎么藏



theString=theString+'<b>Random day of the week:</b> '+getRandomDayoftheweek(i)+'<br><br>';





如果记录为空

香港专业教育学院看到一堆关于如何检查它是否为空的答案,我想一起隐藏文本“一周中的任意一天”

最佳答案

是的,所以我能够弄清楚。现在看来似乎很简单,但在这里是万一其他人有这个问题。



if (getRandomDayoftheweek(i)!=="") {
theString=theString+'<b>Random day of the week:</b> '+getRandomDayoftheweek(i)+'<br><br>';
}

关于javascript - 如果数组中的值在javascript中为空,如何隐藏此字符串,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33702226/

10-11 06:15