TRUE FALSE
{} null
숫자 undefined
“0” 0
“false” -0
Infinity NaN
[] “”
문자열
let a = "";

if(a){
	console.log("TRUE");
} else{
	console.log("FALSE");
}

Untitled

let a = "string";

if(a){
	console.log("TRUE");
} else{
	console.log("FALSE");
}

Untitled

const getName = (person) => {
	if (!person){      // 해당 변수가 null 이든 undefined이든 공백이든 한방에 처리 가능
		// false NOT => True
		return "객체가 아닙니다"	
	}
	return person.name;
};

let person;
const name = getName(person);
console.log(name);

Untitled