This is probably a stupid issue, but I get a string from an API using fetch. I take it from the .json() array, and split it (this first time works successfully). Once I take it from this first split, I need to split it again, but it says TypeError: var2.split is not a function
is not a function. Code below:
let var1 = json[0]["dateTime"];
var1 = var1.split(" - "); // this one works fine
let var2 = var1[0];
var2 = var2.split(", "); // this one fails