Summary
Adds an element to the front of an array.
Description
Adds one element to the beginning of an array.
Route
No Northbound API Available
Roles
Parameters
DetailsExampleSchema
Name |
Type |
Required |
Description |
arr |
array |
yes |
The array to unshift |
elementN |
* |
yes |
The element to add to the front of the array |
Copied to Clipboard
{
"arr": [
"oldDevice"
],
"elementN": "newDevice"
}
Copied to Clipboard
{
"type": "object",
"properties": {
"arr": {
"title": "arr",
"type": "array",
"items": [
{
"type": [
"string",
"number",
"integer",
"object",
"array",
"boolean",
"null"
]
}
],
"examples": [
[
"oldDevice"
]
]
},
"elementN": {
"type": [
"array",
"string",
"boolean",
"integer",
"number",
"object"
],
"title": "elementN",
"examples": [
"newDevice"
]
}
},
"required": [
"arr",
"elementN"
],
"additionalProperties": false
}
Return
DetailsExampleSchema
Name |
Type |
Description |
unshiftedArray |
array |
The shifted array with new elements at the front |
Copied to Clipboard
[
"newDevice",
"oldDevice"
]
Copied to Clipboard
{
"title": "unshiftedArray",
"type": "array",
"items": [
{
"type": [
"string",
"number",
"integer",
"object",
"array",
"boolean",
"null"
]
}
],
"examples": [
[
"newDevice",
"oldDevice"
]
]
}