# Boolean - Mantıksal

**`Boolean`** veri tipi sadece **`true`** veya **`false`** olarak iki değer tutar. Örnek.

{% code lineNumbers="true" %}

```javascript
let dogru = true;
let yanlis = false;
alert(dogru);
alert(yanlis);
alert(typeof dogru);
alert(typeof yanlis);
```

{% endcode %}

**`Boolean`** veri tipinin genel kullanımı tabii ki bu şekilde değildir. Genellikle karşılaştırma, üyelik veya değer kontrolü sonucu olarak elde edilir.

[Operatörler](https://hanuce.gitbook.io/javascript-egitimi/operatorler) konusunda **`boolean`** tipini daha detaylı işleyeceğiz.

Örnek bir karşılaştırma ifade etmek gerekirse; **`2 > 3;`** ifadesi sonucunda **`false`** değeri elde edilir.

{% code lineNumbers="true" %}

```javascript
alert(2 > 3); // false çıktısı verir.
```

{% endcode %}

Yine aynı şekilde eşitlik karşılaştırması da yapılabilir. Örnek.

{% code lineNumbers="true" %}

```javascript
alert(2023 == 2023); // true çıktısı verir.
```

{% endcode %}

Matematiksel olarak **`true`** 1 (bir) **`false`** 0 (sıfır) değerine eşittir.

Karakter dizilerinde ise herhangi bir karakter içeren **`string`** **`true`**, boş **`string`** değeri **`false`** olur.


---

# 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://hanuce.gitbook.io/javascript-egitimi/ilkel-primitive-veri-tipleri/boolean-mantiksal.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.
