aboutsummaryrefslogtreecommitdiff
path: root/files/uk/web/javascript/reference/operators/less_than/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/uk/web/javascript/reference/operators/less_than/index.html')
-rw-r--r--files/uk/web/javascript/reference/operators/less_than/index.html99
1 files changed, 99 insertions, 0 deletions
diff --git a/files/uk/web/javascript/reference/operators/less_than/index.html b/files/uk/web/javascript/reference/operators/less_than/index.html
new file mode 100644
index 0000000000..9833b8532e
--- /dev/null
+++ b/files/uk/web/javascript/reference/operators/less_than/index.html
@@ -0,0 +1,99 @@
+---
+title: Менше ніж (<)
+slug: Web/JavaScript/Reference/Operators/Less_than
+tags:
+ - JavaScript
+ - Довідка
+ - Оператор
+translation_of: Web/JavaScript/Reference/Operators/Less_than
+---
+<div>{{jsSidebar("Operators")}}</div>
+
+<p>Оператор менше ніж (<code>&lt;</code>) повертає <code>true</code>, якщо значення лівого операнда менше за значення правого операнда, інакше повертає <code>false</code>.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/expressions-less-than.html")}}</div>
+
+
+
+<h2 id="Синтаксис">Синтаксис</h2>
+
+<pre class="syntaxbox notranslate"> x &lt; y</pre>
+
+<h2 id="Опис">Опис</h2>
+
+<p>Операнди порівнюються за допомогою алгоритму <a class="external external-icon" href="https://tc39.es/ecma262/#sec-abstract-relational-comparison" rel="noopener">абстрактного порівняння</a>. Дивіться опис алгоритму у документації оператора <a href="/uk/docs/Web/JavaScript/Reference/Operators/Greater_than">більше ніж</a>.</p>
+
+<h2 id="Приклади">Приклади</h2>
+
+<h3 id="Порівняння_рядків">Порівняння рядків</h3>
+
+<pre class="brush: js notranslate">console.log("а" &lt; "б"); // true
+console.log("а" &lt; "а"); // false
+console.log("а" &lt; "3"); // false</pre>
+
+<h3 id="Порівняння_рядка_з_числом">Порівняння рядка з числом</h3>
+
+<pre class="brush: js notranslate">console.log("5" &lt; 3); // false
+console.log("3" &lt; 3); // false
+console.log("3" &lt; 5); // true
+
+console.log("привіт" &lt; 5); // false
+console.log(5 &lt; "привіт"); // false
+
+console.log("5" &lt; 3n); // false
+console.log("3" &lt; 5n); // true</pre>
+
+<h3 id="Порівняння_числа_з_числом">Порівняння числа з числом</h3>
+
+<pre class="brush: js notranslate">console.log(5 &lt; 3); // false
+console.log(3 &lt; 3); // false
+console.log(3 &lt; 5); // true</pre>
+
+<h3 id="Порівняння_числа_з_BigInt">Порівняння числа з BigInt</h3>
+
+<pre class="brush: js notranslate">console.log(5n &lt; 3); // false
+console.log(3 &lt; 5n); // true</pre>
+
+<h3 id="Порівняння_Boolean_null_undefined_NaN">Порівняння Boolean, null, undefined, NaN</h3>
+
+<pre class="brush: js notranslate">console.log(true &lt; false); // false
+console.log(false &lt; true); // true
+
+console.log(0 &lt; true); // true
+console.log(true &lt; 1); // false
+
+console.log(null &lt; 0); // false
+console.log(null &lt; 1); // true
+
+console.log(undefined &lt; 3);    // false
+console.log(3 &lt; undefined);    // false
+
+console.log(3 &lt; NaN); // false
+console.log(NaN &lt; 3); // false</pre>
+
+<h2 id="Специфікації">Специфікації</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Специфікація</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-relational-operators', 'Relational operators')}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Сумісність_з_веб-переглядачами">Сумісність з веб-переглядачами</h2>
+
+
+
+<p>{{Compat("javascript.operators.less_than")}}</p>
+
+<h2 id="Див._також">Див. також</h2>
+
+<ul>
+ <li><a href="/uk/docs/Web/JavaScript/Reference/Operators/Greater_than">Оператор більше ніж</a></li>
+ <li><a href="/uk/docs/Web/JavaScript/Reference/Operators/Greater_than_or_equal">Оператор більше чи дорівнює</a></li>
+ <li><a href="/uk/docs/Web/JavaScript/Reference/Operators/Less_than_or_equal">Оператор менше чи дорівнює</a></li>
+</ul>