diff options
author | Florian Dieminger <me@fiji-flo.de> | 2021-02-11 18:29:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 18:29:28 +0100 |
commit | 964decad361766e85d928a56f0ab80af0e75c172 (patch) | |
tree | 64e802be7fd6e93243b93f5813fe7ae2873ac1b3 /files/vi/glossary/falsy/index.html | |
parent | 890776270440331dcd24d34dc5e1cef2167aa70a (diff) | |
parent | 9201e4212c57af09becda69f17c17a3a34f226c2 (diff) | |
download | translated-content-964decad361766e85d928a56f0ab80af0e75c172.tar.gz translated-content-964decad361766e85d928a56f0ab80af0e75c172.tar.bz2 translated-content-964decad361766e85d928a56f0ab80af0e75c172.zip |
Merge pull request #61 from fiji-flo/unslugging-vi
Unslugging vi
Diffstat (limited to 'files/vi/glossary/falsy/index.html')
-rw-r--r-- | files/vi/glossary/falsy/index.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/files/vi/glossary/falsy/index.html b/files/vi/glossary/falsy/index.html new file mode 100644 index 0000000000..7b39f3e98b --- /dev/null +++ b/files/vi/glossary/falsy/index.html @@ -0,0 +1,33 @@ +--- +title: Falsy +slug: Glossary/Falsy +translation_of: Glossary/Falsy +original_slug: Tu-dien-thuat-ngu/Falsy +--- +<p id="Summary">Giá trị <strong>falsy</strong> là giá trị được hiểu là <em>false</em> trong ngữ cảnh {{Glossary("Boolean")}}.</p> + +<p>{{Glossary("JavaScript")}} sử dụng {{Glossary("Type_Conversion", "Type Conversion")}} để ép kiểu giá trị bất kì thành Boolean khi cần thiết, ví dụ trong mệnh đề điều kiện ({{Glossary("Conditional", "conditionals")}}) và vòng lặp ({{Glossary("Loop", "loops")}}).</p> + +<h2 id="Ví_dụ">Ví dụ</h2> + +<p>Sau đây là ví dụ về các giá trị <em>falsy</em> (sẽ được hiểu là 'false' dẫn đến không thực hiện đoạn code của <code>if</code> ):</p> + +<pre class="brush: js">if (false) +if (null) +if (undefined) +if (0) +if (NaN) +if ('') +if ("") +if (document.all) [1]</pre> + +<p>[1] <code>document.all</code> trước đây được sử dụng trong việc nhận biết trình duyệt và tài liệu <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dom-document-all">HTML specification defines a willful violation</a> của chuẩn ECMAScript này để tương thích với code cũ (<code>if (document.all) { // Internet Explorer code here }</code> hoặc sử dụng <code>document.all</code> mà không kiểm tra trước về sự tồn tại của nó: <code>document.all.foo</code>).</p> + +<p>Đôi khi từ này được viết là <strong>falsey</strong>.</p> + +<h2 id="Tìm_hiểu_thêm">Tìm hiểu thêm</h2> + +<ul> + <li>{{Glossary("Truthy")}}</li> + <li>{{Glossary("Boolean")}}</li> +</ul> |