I'm trying to "change" values of a received vector from the consumption of a JSON.
My logic was to create a for
to go through the vector, parse the item on that partition and rewrite it in a copy vector, thus having a vector with the values I want.
let copia = [];
for(i = 0; i< data.day.lenght; i++){
switch(data.day[i]){
case 'Mon':
copia[i] = 'Segunda';
default:
copia[i] = 'Não'
}
}
return(
<Text style = {styles.welcome}>Day: {copia}</Text>)
The problem is that my vector copy is coming out blank every time. What do you think?