If you perform the following action
var array = [78];
You will create an array containing one element, which is the number 78
, and its length will be 1
.
When viewed in the console, you will see a representation of the array displaying Array[length]
, indicating that it is indeed an array with a length of 1
.
The array still holds the value 78
, but this is just how the browser chooses to display it.
If you intended for the array to have a length of 78
, that would require a different approach. Similarly, if you wanted the value to be interpreted as a string (which might make sense if it's meant to represent an employee ID), you could do the following:
{ "employeeId": "[78]" }
Alternatively, you could eliminate the brackets and simply use the number for the ID like so:
{ "employeeId": 78 }