From 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:43:23 -0500 Subject: initial commit --- .../reference/global_objects/infinity/index.html | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 files/vi/web/javascript/reference/global_objects/infinity/index.html (limited to 'files/vi/web/javascript/reference/global_objects/infinity') diff --git a/files/vi/web/javascript/reference/global_objects/infinity/index.html b/files/vi/web/javascript/reference/global_objects/infinity/index.html new file mode 100644 index 0000000000..73e388b0d1 --- /dev/null +++ b/files/vi/web/javascript/reference/global_objects/infinity/index.html @@ -0,0 +1,81 @@ +--- +title: Infinity +slug: Web/JavaScript/Reference/Global_Objects/Infinity +translation_of: Web/JavaScript/Reference/Global_Objects/Infinity +--- +
{{jsSidebar("Objects")}}
+ +

Thuộc tính global Infinity là giá trị kiểu số biểu diễn vô cùng.

+ +

{{js_property_attributes(0,0,0)}}

+ +
{{EmbedInteractiveExample("pages/js/globalprops-infinity.html")}}
+ + + +

Cú pháp

+ +
Infinity 
+ +

Mô tả

+ +

Infinity là một thuộc tính của global object, hay nói các khác, là một biến trong global scope.

+ +

Giá trị khởi đầu của Infinity là {{jsxref("Number.POSITIVE_INFINITY")}}. Giá trị Infinity (dương vô cùng) lớn hơn mọi số. Về mặt toán học, giá trị này có biểu hiện giống hệt với vô cùng; chẳng hạn, mọi số dương nhân với Infinity đều bằng Infinity, và mọi số chia cho Infinity đều bằng 0.

+ +

Như đã định nghĩa trong bản đặc tả ECMAScript 5, Infinity là chỉ-đọc (cài đặt trong JavaScript 1.8.5 / Firefox 4).

+ +

Ví dụ

+ +
console.log(Infinity          ); /* Infinity */
+console.log(Infinity + 1      ); /* Infinity */
+console.log(Math.pow(10, 1000)); /* Infinity */
+console.log(Math.log(0)       ); /* -Infinity */
+console.log(1 / Infinity      ); /* 0 */
+
+ +

Đặc tả

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Đặc tảTrạng tháiGhi chú
{{SpecName('ES1')}}{{Spec2('ES1')}}Định nghĩa lần đầu. Cài đặt trong JavaScript 1.3
{{SpecName('ES5.1', '#sec-15.1.1.2', 'Infinity')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-value-properties-of-the-global-object-infinity', 'Infinity')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-value-properties-of-the-global-object-infinity', 'Infinity')}}{{Spec2('ESDraft')}} 
+ +

Trình duyệt hỗ trợ

+ + + +

{{Compat("javascript.builtins.Infinity")}}

+ +

Xem thêm

+ + -- cgit v1.2.3-54-g00ecf