I know nothing about that library, but if the properties are in fact arrays, then are you sure they should be enclosed within square brackets in the code? That would make each of them an array of an array.
Are you trying to send a string and turn it into an array of numbers? I’ve got it working fine on my end
the inputs just need to be comma separated lists. it’d be easier to bring in actual lists, but this serves the example
function(properties, context) {
// Load Chance
var Chance = require('chance');
// Instantiate Chance so it can be used
var chance = new Chance();
// Use Chance here.
var my_random_string = chance.weighted(properties.texts.split(','), properties.numbers.split(',').map(function(item) {
return parseInt(item, 10);
}));
return {
"poop":my_random_string
}
}