SOURCE

let str1=undefined
let str2= 'aaa'

if (str1){
    console.log('str1 if 是 true')
}

if (!str1 && str2){
    console.log('str1空,str2非空')
}
else{
    console.log('其它情况')
}

const validDomains = ['stars-dev.gf.com.cn','stars-tst.gf.com.cn','stars.gf.com.cn','star.gf.com.cn']
let location1 = 'star.gf.com.cn'
if (validDomains.includes(location1)){
    console.log('location1 in validDomains')
}
else{
    console.log('location1 not in validDomains')
}

let str3 = "240509.1.T+1.Broker    最优\nBroker    最优\nName: 240509.1.T+1, dtype: object"
str4 = encodeURI(str3)
console.log(str4)

for(let i=0;i<100;i++){
    let no = 0.01*i
    console.log(no,typeof no)
}
console 命令行工具 X clear

                    
>
console