在google docs脚本中添加和/或if语句的子句

Tai*_*oon 1 google-sheets google-apps-script

我需要在google脚本中包含和/或声明if条件.我是脚本的新手,我无法找到这样做的方法.请帮忙

if (dateval<>"") and (repval<>"") {condition if true}
Run Code Online (Sandbox Code Playgroud)

感谢您的帮助.

Ser*_*sas 6

你可以在这个网站上找到该主题(和其他)的所有信息.

在你的例子中答案是

if (dateval!="" && repval!="") {do something}
Run Code Online (Sandbox Code Playgroud)


use*_*612 6

逻辑符号
或 ||
并且 && 等于 == 不是 !=

https://www.w3schools.com/js/js_comparisons.asp