# 연산자 boolean

```javascript
//false : 0, -0 (0은 fasle), '' , null undefined -> 비어있는 값은 다 false
// true : -1  (0을 제외한 숫자 true)  '값이 있는 문자' , [ 비어있는 배열]

let num = 9;

if(num){ 
  console.log(num); // 9
}

num && console.log(num); // 9 && -> 앞이 true여야 실행이됨 

let obj = {
    name: 'ellie',
    age: 20
};

if(num){ 
  console.log(obj.name); // ellie
}

obj && console.log(obj.name); // ellie
// -> if와 &&연산자를 쓰는것은 동일한 역활을 한다.
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://leeboa.gitbook.io/study/_/undefined-3/boolean.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
