I'm using JS inside MaxMSP
I would like to take a string output (of separated by comma single fibonacci numbers) and convert it to either an array or number, keeping the space and commas but getting ride of the "double quotes"
I've tried a bunch of stuff here but unfortunately I'm still banging my head against the wall.
autowatch = 1;
inlets = 2;
outlets = 2;
function msg_int(num){
var a = 1;
var b = 0, temp;
while (num >= 0){
temp = a;
a = a + b;
b = temp;
num--;
outlet(0, b);
var n = temp;
digits = n.toString().replace(/(\d{1})/g,'$1, ')
outlet(1, digits);
}
return b;
}
The Input number is 14 The first outlet(0) number is 610 The second outlet(1) is "6, 1, 0, "
I would like the second outlet to be 6, 1, 0,