Here is my array:
const main = [
[['02:20:21,369'], ['02:20:21,369'], ['02:20:21,369'], ['02:20:21,369']],
[['02:20:21,369'], ['02:20:21,369']],
[['02:20:21,369'], ['02:20:21,369'], ['02:20:21,369']],
[['02:20:21,369']],
];
and here is my function:
const convertor = (x) => {
const splitted = x.split(':');
console.log(splitted);
const converted = splitted[0] * 60 + splitted[1] * 60 + splitted[2];
return converted;
};
I want to map this function on each nested array
I tried this but I got an error:
const resu = main.map((x) => {
x.map((y) => {
convertor(y);
});
});
x.split is not a function