Tables with holes cause inconsistent behaviour depending on whether or not the nils are explicitly entered into the table.
A hole of size 1 seems to work fine, and a null is returned in the output array.
A hole of size 2 however will ONLY fill with null if the nil values are specifically typed in the array.
See the following, commented with their output when run in the Studio command bar.
print(game.HttpService:JSONEncode({1,2,nil,nil,5})) -- "[1,2,null,null,5]"
print(game.HttpService:JSONEncode({1,2,nil,4})) -- "[1,2,null,4]"
print(game.HttpService:JSONEncode({[1]=1, [2]=2, [4]=4})) -- "[1,2,null,4]"
print(game.HttpService:JSONEncode({[1]=1,[2]=2,[5]=5})) -- "[1,2]"
Notice how in the last one, the [5]=5 is not included in the resulting array, which is unexpected.
I checked the Creator Docs and this isn’t documented anywhere, (it says it never produces nil but it literally does. its probably talking about Objects not Arrays though…) so it seems like either a bug or a documentation flaw.
Also, all the outputs turn into what you’d expect when you run them through HttpService:JSONDecode(), which also produces nils.
I can provide system information if needed, but this feels more like an implementation issue than a hardware-specific problem.
Expected behavior
Not having the inconsistencies would be nice, so either the first and last could both return [1,2,null,null,5] or the holes could cause it to stop adding to the array in all cases.
Even just documenting that arrays with holes may have inconsistent behaviour would make it easier for others to find the problem should they run into a similar issue. (though, i doubt many games have the same level of Crimes Against Programming that make this an actual issue haha)