Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
unidocs-zh
提交
bbc8f399
unidocs-zh
项目概览
DCloud
/
unidocs-zh
通知
3592
Star
108
Fork
920
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
120
列表
看板
标记
里程碑
合并请求
108
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
unidocs-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
120
Issue
120
列表
看板
标记
里程碑
合并请求
108
合并请求
108
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
bbc8f399
编写于
8月 07, 2023
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: buildInObject array.md、number.md
上级
88392e1f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
94 addition
and
1089 deletion
+94
-1089
docs/.vuepress/config/navbar.js
docs/.vuepress/config/navbar.js
+2
-2
docs/.vuepress/utils/utsJson.json
docs/.vuepress/utils/utsJson.json
+1
-1063
docs/uts/buildin-object-api/array.md
docs/uts/buildin-object-api/array.md
+9
-1
docs/uts/buildin-object-api/number.md
docs/uts/buildin-object-api/number.md
+82
-23
未找到文件。
docs/.vuepress/config/navbar.js
浏览文件 @
bbc8f399
...
@@ -42,11 +42,11 @@ export const navbar = [
...
@@ -42,11 +42,11 @@ export const navbar = [
type
:
'
link
'
,
type
:
'
link
'
,
link
:
'
/uts/
'
link
:
'
/uts/
'
},
},
{
/*
{
text: 'uni-app x',
text: 'uni-app x',
type: 'link',
type: 'link',
link: '/uni-app-x/'
link: '/uni-app-x/'
},
},
*/
{
{
text
:
'
插件
'
,
text
:
'
插件
'
,
type
:
'
link
'
,
type
:
'
link
'
,
...
...
docs/.vuepress/utils/utsJson.json
浏览文件 @
bbc8f399
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
docs/uts/buildin-object-api/array.md
浏览文件 @
bbc8f399
...
@@ -522,7 +522,13 @@ console.log(sumWithInitial);
...
@@ -522,7 +522,13 @@ console.log(sumWithInitial);
<!-- UTSJSON.Array.reduceRight.compatibility -->
<!-- UTSJSON.Array.reduceRight.compatibility -->
### isArray()
### isArray(arg)
<!-- UTSJSON.Array.isArray.description -->
<!-- UTSJSON.Array.isArray.param -->
<!-- UTSJSON.Array.isArray.returnValue -->
```
ts
```
ts
console
.
log
(
Array
.
isArray
([
1
,
3
,
5
]));
console
.
log
(
Array
.
isArray
([
1
,
3
,
5
]));
...
@@ -538,6 +544,8 @@ console.log(Array.isArray(new Int16Array([15, 33])));
...
@@ -538,6 +544,8 @@ console.log(Array.isArray(new Int16Array([15, 33])));
// Expected output: false
// Expected output: false
```
```
<!-- UTSJSON.Array.isArray.compatibility -->
## 常见操作
## 常见操作
-
创建数组
-
创建数组
...
...
docs/uts/buildin-object-api/number.md
浏览文件 @
bbc8f399
...
@@ -26,55 +26,114 @@ console.log(financial(0.004));
...
@@ -26,55 +26,114 @@ console.log(financial(0.004));
<!-- UTSJSON.Number.toFixed.compatibility -->
<!-- UTSJSON.Number.toFixed.compatibility -->
### to
Byte
()
### to
Int
()
toByte() 方法将当前的Number数据转换为Byte表示,如果超出Byte最大值表示范围,会得到溢出后余数表示
<!-- UTSJSON.Number.toInt.description -->
**平台差异说明**
<!-- UTSJSON.Number.toInt.param -->
|JavaScript|Kotlin|Swift|
<!-- UTSJSON.Number.toInt.returnValue -->
|:-:|:-:|:-:|
|√|√|x|
```
ts
```
ts
let
a
=
12
let
a
=
12
console
.
log
(
a
.
to
Byte
());
console
.
log
(
a
.
to
Int
());
// expected output: 12
// expected output: 12
// Int最大值2147483647,溢出了
let
b
=
2147483648
// expected output: -2147483648
```
```
<!-- UTSJSON.Number.toInt.compatibility -->
### toInt()
### toFloat()
<!-- UTSJSON.Number.toFloat.description -->
<!-- UTSJSON.Number.toFloat.param -->
<!-- UTSJSON.Number.toFloat.returnValue -->
<!-- UTSJSON.Number.toFloat.compatibility -->
### toDouble()
<!-- UTSJSON.Number.toDouble.description -->
<!-- UTSJSON.Number.toDouble.param -->
<!-- UTSJSON.Number.toDouble.returnValue -->
<!-- UTSJSON.Number.toDouble.compatibility -->
### toUInt()
<!-- UTSJSON.Number.toUInt.description -->
<!-- UTSJSON.Number.toUInt.param -->
<!-- UTSJSON.Number.toUInt.returnValue -->
<!-- UTSJSON.Number.toUInt.compatibility -->
### toByte()
toInt() 方法将当前的Number数据转换为Int表示,如果超出Int最大值表示范围,会得到溢出后余数表示
<!-- UTSJSON.Number.toByte.description -->
**平台差异说明**
<!-- UTSJSON.Number.toByte.param -->
|JavaScript|Kotlin|Swift|
<!-- UTSJSON.Number.toByte.returnValue -->
|:-:|:-:|:-:|
|√|√|√
`(3.6.11+)`
|
```
ts
```
ts
let
a
=
12
let
a
=
12
console
.
log
(
a
.
to
Int
());
console
.
log
(
a
.
to
Byte
());
// expected output: 12
// expected output: 12
// Int最大值2147483647,溢出了
let
b
=
2147483648
// expected output: -2147483648
```
```
<!-- UTSJSON.Number.toByte.compatibility -->
### toLong()
### toLong()
toLong() 方法将当前的Number数据转换为Long表示,如果超出Long最大值表示范围,会得到溢出后余数表示
<!-- UTSJSON.Number.toLong.description -->
**平台差异说明**
<!-- UTSJSON.Number.toLong.param -->
|JavaScript|Kotlin|Swift|
<!-- UTSJSON.Number.toLong.returnValue -->
|:-:|:-:|:-:|
|√|√|x|
```
ts
```
ts
let
a
=
12
let
a
=
12
console
.
log
(
a
.
toLong
());
console
.
log
(
a
.
toLong
());
// expected output: 12
// expected output: 12
```
```
<!-- UTSJSON.Number.toLong.compatibility -->
### toShort()
<!-- UTSJSON.Number.toShort.description -->
<!-- UTSJSON.Number.toShort.param -->
<!-- UTSJSON.Number.toShort.returnValue -->
<!-- UTSJSON.Number.toShort.compatibility -->
### toUShort()
<!-- UTSJSON.Number.toUShort.description -->
<!-- UTSJSON.Number.toUShort.param -->
<!-- UTSJSON.Number.toUShort.returnValue -->
<!-- UTSJSON.Number.toUShort.compatibility -->
### toULong()
<!-- UTSJSON.Number.toULong.description -->
<!-- UTSJSON.Number.toULong.param -->
<!-- UTSJSON.Number.toULong.returnValue -->
<!-- UTSJSON.Number.toULong.compatibility -->
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录