Summary
Copies part of an array within the same array.
Description
Shallow copies part of an array to another location in the same array and returns it, without modifying its size.
Route
No Northbound API Available
Roles
Parameters
DetailsExampleSchema
Name |
Type |
Required |
Description |
arr |
array |
yes |
The array to copy |
target |
number |
yes |
Zero based index at which to copy the sequence to |
start |
number |
no |
Zero based index at which to start copying elements from |
end |
number |
no |
Zero based index at which to end copying elements from |
Copied to Clipboard
{
"arr": [
"a",
"b",
"c",
"d"
],
"target": 2,
"start": 0,
"end": 2
}
Copied to Clipboard
{
"type": "object",
"properties": {
"arr": {
"title": "arr",
"type": "array",
"items": [
{
"type": [
"string",
"number",
"integer",
"object",
"array",
"boolean",
"null"
]
}
],
"examples": [
[
"a",
"b",
"c",
"d"
]
]
},
"target": {
"title": "target",
"type": "integer",
"examples": [
2
]
},
"start": {
"title": "start",
"type": "integer",
"examples": [
0
]
},
"end": {
"title": "end",
"type": "integer",
"examples": [
2
]
}
},
"required": [
"arr",
"target"
],
"additionalProperties": false
}
Return
DetailsExampleSchema
Name |
Type |
Description |
copiedArray |
array |
The modified array |
Copied to Clipboard
[
"a",
"b",
"a",
"b"
]
Copied to Clipboard
{
"title": "copiedArray",
"type": "array",
"items": [
{
"type": [
"string",
"number",
"integer",
"object",
"array",
"boolean",
"null"
]
}
],
"examples": [
[
"a",
"b",
"a",
"b"
]
]
}