GarrettZhang
1/20/2018 - 6:49 AM

短路求值

if (variable1 !== null || variable1 !== undefined || variable1 !== '') {
  let variable2 = variable1;
}

// 简写
const variable2 = variable1 || 'new'