我有两个数组as types
和defaultTypes
。我需要显示types
默认值array defaultTypes
。
const types = [
{
Id: 2,
Name: 'Some value here'
},
{
Id: 3,
Name: 'Some value here'
},
{
Id: 4,
Name: 'Some value here'
}
];
const defaultTypes = [
{
Id: 1,
Name: 'Default value 1'
},
{
Id: 2,
Name: 'Default value 2'
}
]
Run Code Online (Sandbox Code Playgroud)
如果in types
中不存在某些默认类型(在这种情况下,Id:1在types
数组中不存在)。我需要在types
数组中添加该对象。预期结果将是:
const expectedTypes = [
{
Id: 1,
Name: '-'
},
{
Id: 2,
Name: …
Run Code Online (Sandbox Code Playgroud) 我是科特林的新手。谁能给我解释一下这行代码?特别?
是这里的类型是什么意思?
private var verificationId: String? = null
Run Code Online (Sandbox Code Playgroud)