diff options
| author | Florian Merz <me@fiji-flo.de> | 2021-02-11 14:51:31 +0100 |
|---|---|---|
| committer | Florian Merz <me@fiji-flo.de> | 2021-02-11 14:51:31 +0100 |
| commit | 8f2731905212f6e7eb2d9793ad20b8b448c54ccf (patch) | |
| tree | 68b111146b149114ea5913c4ad6d1dfad9e839e3 /files/tr/web/javascript/reference/operatörler/mantiksal_operatorler | |
| parent | 8260a606c143e6b55a467edf017a56bdcd6cba7e (diff) | |
| download | translated-content-8f2731905212f6e7eb2d9793ad20b8b448c54ccf.tar.gz translated-content-8f2731905212f6e7eb2d9793ad20b8b448c54ccf.tar.bz2 translated-content-8f2731905212f6e7eb2d9793ad20b8b448c54ccf.zip | |
unslug tr: move
Diffstat (limited to 'files/tr/web/javascript/reference/operatörler/mantiksal_operatorler')
| -rw-r--r-- | files/tr/web/javascript/reference/operatörler/mantiksal_operatorler/index.html | 312 |
1 files changed, 0 insertions, 312 deletions
diff --git a/files/tr/web/javascript/reference/operatörler/mantiksal_operatorler/index.html b/files/tr/web/javascript/reference/operatörler/mantiksal_operatorler/index.html deleted file mode 100644 index 8a1e2ea56f..0000000000 --- a/files/tr/web/javascript/reference/operatörler/mantiksal_operatorler/index.html +++ /dev/null @@ -1,312 +0,0 @@ ---- -title: Mantıksal Operatörler -slug: Web/JavaScript/Reference/Operatörler/Mantiksal_Operatorler -tags: - - Değil - - JavaScript - - Mantıksal Operatörler - - Operator - - Referans - - ve - - ya da -translation_of: Web/JavaScript/Reference/Operators -translation_of_original: Web/JavaScript/Reference/Operators/Logical_Operators ---- -<div>{{jsSidebar("Operators")}}</div> - -<p>Mantıksal operatörler genellikle {{jsxref("Boolean")}} (mantıksal) değerleri ile kullanılır. Kullanıldıklarında, bir boolean değer döndürürler. Ancak, <code>&&</code> ve <code>||</code> operatörleri aslında belirtilmiş olan operandlardan birinin değerini döndürür, bu sebeple eğer bu operatörler Boolean olmayan değerler ile kullanılırsa, Boolean olmayan değerler üretebilirler.</p> - -<h2 id="Açıklama">Açıklama</h2> - -<p>Mantıksal operatörler aşağıdaki tabloda açıklanıyor:</p> - -<table class="fullwidth-table"> - <tbody> - <tr> - <th>Operatör</th> - <th>Kullanım</th> - <th>Açıklama</th> - </tr> - <tr> - <td>Mantıksal VE (<code>&&</code>)</td> - <td><code><em>expr1</em> && <em>expr2</em></code></td> - <td>Eğer <code>expr1</code> false değerine dönüştürülebilirse, <code>expr1</code> döndürülür. Aksi halde, <code>expr2</code> döndürülür. Böylece, Boolean değerleri ile kullanıldıklarında, <code>&&</code> her iki operand <code>true</code> ise <code>true</code> ; aksi halde, <code>false</code> döndürür.</td> - </tr> - <tr> - <td>Mantıksal YA DA (<code>||</code>)</td> - <td><code><em>expr1</em> || <em>expr2</em></code></td> - <td>Eğer <code>expr1</code> true değerine dönüştürülebilirse, expr1 döndürülür, aksi halde, <code>expr2</code> döndürülür. Böylece, Boolean değerleri ile kullanıldıklarında, <code>||</code> her iki operanddan herhangi biri <code>true</code> ise <code>true</code> döndürür.</td> - </tr> - <tr> - <td>Mantıksal DEĞİL (<code>!</code>)</td> - <td><code>!<em>expr</em></code></td> - <td>Eğer operandın değeri <code>true</code> is false döndürür, aksi alde <code>true</code> döndürür.</td> - </tr> - </tbody> -</table> - -<p>Eğer bir değer <code>true</code> değerine dönüştürülebiliyorsa, ona {{Glossary("truthy")}} ismi verilir. Eğer bir değer <code>false</code> değerine dönüştürülebiliyorsa, ona {{Glossary("falsy")}} denir.</p> - -<p><code><a href="https://developer.mozilla.org/en-US/docs/Glossary/Falsy">False</a></code> değerine dönüştürülebilen ifadelere örnekler:</p> - -<ul> - <li><code>null</code>;</li> - <li><code>NaN;</code></li> - <li><code>0</code>;</li> - <li>boş string (<code>""</code>); </li> - <li><code>undefined</code>.</li> -</ul> - -<p>&& ve || operatörleri <code>Boolean</code> olmayan değerler ile kullanılabiliyor olmasına rağmen, döndürdükleri değerler her zaman <code>Boolean</code> değerlerine çevirilebildiğinden, halen <code>Boolean</code> operatörleri olarak düşünülebilirler.</p> - -<h3 id="Kısa-devre_değerlendirmeleri">Kısa-devre değerlendirmeleri</h3> - -<p>Mantıksal operatörler soldan sağa çalıştırıldıkları gibi, mümkünse aşağıdaki kurallar kullanılarak "kısa devre" testine tabi tutulurlar:</p> - -<ul> - <li><code>false && (<em>herhangi)</em></code> bir kısa devre, false değerine çevrilir.</li> - <li><code>true || (<em>herhangi)</em></code> bir kısa devre, true değerine çevrilir.</li> -</ul> - -<p>Mantık kuralları bu değerlendirmelerin doğruluğunu garantiler. Yukarıdaki ifadelerin tümünün çalıştırılmayacağına, bu sebeple hepsinin yan etkisinin olmayacağına dikkat edin. Ayrıca yukarıdaki ifadenin <code>(herhangi)</code> kısmının tamamıyla bir mantıksal ifadeye eşit olduğuna dikkat edin. (parantezler ile gösterildiği gibi).</p> - -<p>Örneğin, aşağıdaki iki fonksiyon birbirinin aynısıdır.</p> - -<pre class="brush: js">function shortCircuitEvaluation() { - doSomething() || doSomethingElse() -} - -function equivalentEvaluation() { - var flag = doSomething(); - if (!flag) { - doSomethingElse(); - } -} -</pre> - -<p>Ancak, aşağıdaki ifadeler operatör önceliğine göre eşit değildir ve sağ el operatörünün tek bir ifade olmasının önemini vurgular (gerekirse parantezler ile gruplanır).</p> - -<pre class="brush: js">false && true || true // returns true -false && (true || true) // returns false</pre> - -<h3 id="Mantıksal_VE_()"><a name="Logical_AND">Mantıksal VE (<code>&&</code>)</a></h3> - -<p>Aşağıdaki kod && (mantıksal VE) operatörüyle ilgili örnekleri gösterir.</p> - -<pre class="brush: js">a1 = true && true // t && t returns true -a2 = true && false // t && f returns false -a3 = false && true // f && t returns false -a4 = false && (3 == 4) // f && f returns false -a5 = "Cat" && "Dog" // t && t returns "Dog" -a6 = false && "Cat" // f && t returns false -a7 = "Cat" && false // t && f returns false -a8 = "" && false // returns "" -a9 = false && || // returns false -</pre> - -<h3 id="Mantıksal_YA_DA_()"><a name="Logical_OR">Mantıksal YA DA (<code>||</code>)</a></h3> - -<p>Aşağıdaki kod || (mantıksal YA DA) operatörüyle ilgili örnekleri gösterir.</p> - -<pre class="brush: js">o1 = true || true // t || t returns true -o2 = false || true // f || t returns true -o3 = true || false // t || f returns true -o4 = false || (3 == 4) // f || f returns false -o5 = "Cat" || "Dog" // t || t returns "Cat" -o6 = false || "Cat" // f || t returns "Cat" -o7 = "Cat" || false // t || f returns "Cat" -o8 = "" || false // returns false -o9 = false || "" // returns "" -</pre> - -<h3 id="Mantıksal_DEĞİL_(!)"><a name="Logical_NOT">Mantıksal DEĞİL (<code>!</code>)</a></h3> - -<p>Aşağıdaki kod ! (mantıksal DEĞİL) operatörüyle ilgili örnekleri gösterir.</p> - -<pre class="brush: js">n1 = !true // !t returns false -n2 = !false // !f returns true -n3 = !"Cat" // !t returns false -</pre> - -<h3 id="Dönüşüm_kuralları">Dönüşüm kuralları</h3> - -<h4 id="VE_operatörünü_YA_DA_operatörüne_dönüştürmek">VE operatörünü YA DA operatörüne dönüştürmek</h4> - -<p>Booleanları içeren aşağıdaki ifade:</p> - -<pre class="brush: js">bCondition1 && bCondition2</pre> - -<p>her zaman şuna eşittir:</p> - -<pre class="brush: js">!(!bCondition1 || !bCondition2)</pre> - -<h4 id="YA_DA_operatörünü_VE_operatörüne_çevirmek">YA DA operatörünü VE operatörüne çevirmek</h4> - -<p>Booleanları içeren aşağıdaki ifade:</p> - -<pre class="brush: js">bCondition1 || bCondition2</pre> - -<p>her zaman şuna eşittir:</p> - -<pre class="brush: js">!(!bCondition1 && !bCondition2)</pre> - -<h4 id="DEĞİL_operatörleri_arasında_dönüşüm_yapmak">DEĞİL operatörleri arasında dönüşüm yapmak</h4> - -<p>Booleanları içeren aşağıdaki ifade:</p> - -<pre class="brush: js">!!bCondition</pre> - -<p>her zaman şuna eşittir: </p> - -<pre class="brush: js">bCondition</pre> - -<h3 id="İç_içe_geçmiş_parantezleri_kaldırmak">İç içe geçmiş parantezleri kaldırmak</h3> - -<p>Mantıksal operatörlerin soldan sağa değerlendirilmesi durumunda, kompleks bir ifadeden parantezleri bazı kuralları takip ederek kaldırmak mümkündür.</p> - -<h4 id="İç_içe_geçmiş_VE_operatörünü_kaldırmak">İç içe geçmiş VE operatörünü kaldırmak</h4> - -<p>Aşağıda, Boolean içeren bu bileşik işlem:</p> - -<pre class="brush: js">bCondition1 || (bCondition2 && bCondition3)</pre> - -<p>her zaman şuna eşittir:</p> - -<pre class="brush: js">bCondition1 || bCondition2 && bCondition3</pre> - -<h4 id="İç_içe_geçmiş_YA_DA_operatörünü_kaldırmak">İç içe geçmiş YA DA operatörünü kaldırmak</h4> - -<p>Aşağıda, Boolean içeren bu bileşik ifade:</p> - -<pre class="brush: js">bCondition1 && (bCondition2 || bCondition3)</pre> - -<p>her zaman şuna eşittir:</p> - -<pre class="brush: js">!(!bCondition1 || !bCondition2 && !bCondition3)</pre> - -<h2 id="Özellikler">Özellikler</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Özellik</th> - <th scope="col">Durum</th> - <th scope="col">Açıklama</th> - </tr> - <tr> - <td>{{SpecName('ES1')}}</td> - <td>{{Spec2('ES1')}}</td> - <td>İlk tanım.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-11.11')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td>Tarifnamenin birkaç bölümünde tanımlandı: <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.4.9">Logical NOT Operator</a>, <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.11">Binary Logical Operators</a></td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-binary-logical-operators')}}</td> - <td>{{Spec2('ES6')}}</td> - <td>Tarifnamenin birkaç bölümünde tanımlandı: <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-logical-not-operator">Logical NOT Operator</a>, <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-binary-logical-operators">Binary Logical Operators</a></td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-binary-logical-operators')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td>Tarifnamenin birkaç bölümünde tanımlandı: <a href="http://tc39.github.io/ecma262/#sec-logical-not-operator">Logical NOT Operator</a>, <a href="http://tc39.github.io/ecma262/#sec-binary-logical-operators">Binary Logical Operators</a></td> - </tr> - </tbody> -</table> - -<h2 id="Tarayıcı_Uyumluluğu">Tarayıcı Uyumluluğu</h2> - -<p>{{CompatibilityTable}}</p> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Mantıksal VE (<code>&&</code>)</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - <tr> - <td> - <p>Mantıksal YA DA (<code>||</code>)</p> - </td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - <tr> - <td>Mantıksal DEĞİL (<code>!</code>)</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Özellik</th> - <th>Android</th> - <th>Android üzerinde Chrome</th> - <th>Firefox Mobil (Gecko)</th> - <th>IE Mobil</th> - <th>Opera Mobil</th> - <th>Safari Mobil</th> - </tr> - <tr> - <td>Logical AND (<code>&&</code>)</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - <tr> - <td>Logical OR (<code>||</code>)</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - <tr> - <td>Logical NOT (<code>!</code>)</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<h2 id="Ayrıca_bakın">Ayrıca bakın</h2> - -<ul> - <li><a href="/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators">Bitwise operators</a></li> - <li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></li> -</ul> |
