From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- .../global_objects/number/tointeger/index.html | 97 ---------------------- 1 file changed, 97 deletions(-) delete mode 100644 files/zh-cn/web/javascript/reference/global_objects/number/tointeger/index.html (limited to 'files/zh-cn/web/javascript/reference/global_objects/number/tointeger') diff --git a/files/zh-cn/web/javascript/reference/global_objects/number/tointeger/index.html b/files/zh-cn/web/javascript/reference/global_objects/number/tointeger/index.html deleted file mode 100644 index 24abe2125e..0000000000 --- a/files/zh-cn/web/javascript/reference/global_objects/number/tointeger/index.html +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: Number.toInteger() -slug: Web/JavaScript/Reference/Global_Objects/Number/toInteger -translation_of: Archive/Web/JavaScript/Number.toInteger ---- -
{{JSRef("Global_Objects", "Number")}} {{obsolete_header("33")}} {{non-standard_header}}
- -

概览

- -

Number.toInteger() 用来将参数转换成整数,但该方法的实现已被移除.

- -

如果参数是 {{jsxref("Global_Objects/NaN", "NaN")}}, {{jsxref("Global_Objects/null", "null")}} 或 {{jsxref("Global_Objects/undefined", "undefined")}}, 会返回0 . 如果参数值是true返回1,false的话返回0.

- -

语法

- -
Number.toInteger(number)
- -

参数

- -
-
number
-
将被转换成整数的参数.
-
- -

示例

- -

例子: 使用 toInteger()方法

- -
Number.toInteger(0.1);     // 0
-Number.toInteger(1);       // 1
-Number.toInteger(Math.PI); // 3
-Number.toInteger(null);    // 0
-
- -

Specifications

- - - -

浏览器兼容性

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatNo}}Firefox 16 to 32{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatNo}}Firefox 16 to 32{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
- -

See also

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