SOURCE

const x = 20;
const answer = 1 > 10 ? '是我' : '是你'+x;
console.log(answer)

//短路求值
//如果 variable1 是空 或 '' ... 给2 赋值
let variable1 = '修改用户'
const variable2 = variable1  || '添加用户';

console.log(variable2)

//简写多个变量,
var a,b,c,d,e=3,f;
console.log(e)


let aa = true;
if (aa) {
    console.log(aa)
}
//简写 for循环
let rol = [{'id':1},{'id':2},{'id':3}]
for(let i in rol){
    console.log(rol[i].id)
}

 let fn1 = i=>{
     console.log(i)
 }
 fn1('sdfa')
//forEach
let a2 = (item,index,itmes) => {
    console.log("a[" + index + "] = " + item);
}
 [1,2,3].forEach(a2)

 //-------------------------------
 let dbHost;
 let host = '';
    if (host) {
    dbHost = process.env.DB_HOST;
    } else {
    dbHost = 'localhost';
    }
console 命令行工具 X clear

                    
>
console