You need to write a function that translates a two-dimensional array (array of arrays) into CSV format and return a string.
My code:
console.log(arraysToCsv([[1, 2], ['a', 'b']])) 
console.log(arraysToCsv([[1, 2], ['a,b', 'c,d']])) 
function arraysToCsv(data) {
  for (let i = 0; i < data.length; i++) {
    if (data[i] == 'number') {
      return data[i];
    }
    if (data[i] == 'string') {
      return `'${data[i].join('')}'`
    }
    return data[i].join();
  }
}Checks do not pass for some reason. How do I separate numbers and strings, strings should be in quotation marks?
 
    