I want to check if object has a field with value then return default value if it has not..
function testFun(value, defaultvalue) {
if (!value) {
console.log(defaultvalue)
} else {
console.log(value)
}
}
let testVar
testFun(testVar, 'this is default vaue')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…