You would need to get the length before you string...
# suitescript
e
You would need to get the length before you stringify