Search code examples
arrayscoldfusioncoldfusion-11

ArrayResize() creates undefined objects


I want an array of 16 blank items

I don't want to

this.arConfig = ['','','','','','','','','','','','','','','','',''];

When I try

ArrayResize(this.arConfig, 16);

I get

enter image description here

Is there a way to cleanly load this. Note: I expect that someday 16 won't be enough.


Solution

  • Just don't use ArrayResize() for such a small array. It is meant for LARGE arrays. Anyway, that's how it works, what do you expect? Anyway, there's ArraySet() if you really need it.

    https://wikidocs.adobe.com/wiki/display/coldfusionen/ArraySet