MZ array.length is not correct - what's it doing?

I'm making a plugin in MZ where one of the parameters is defined as:
Code:
@param allValues
@type number[]
@default ["10","20","30","40","50","60","70"]

It is showing up correctly in my plugins.js file.

In my code, I've added
Code:
var allValues = params.allValues; // after getting all the parameters into params
alert('There are %1 values'.format(allValues.length));
alert(allValues);

and the alerts it gives are:

There are 36 values
["10","20","30","40","50","60","70"]


Why is it telling me the length is 36, when there are only 7?


Edit: okay, seems to be counting the number of characters in the string, so I guess I need to convert it to an array.

Edit2: Yep, I needed to JSON.parse the string first.

I love how you guys are always so helpful 🙂

Original thread: https://forums.rpgmakerweb.com/threads/array-length-is-not-correct-whats-it-doing.131684/