1
For example: If I have an array that stores the hours and another array that will store the minutes
const arrayHora = [10]
const arrayMinuto = [53]
How would you join the two values of the arrays together to be = [1053] or = [10:53]
1
For example: If I have an array that stores the hours and another array that will store the minutes
const arrayHora = [10]
const arrayMinuto = [53]
How would you join the two values of the arrays together to be = [1053] or = [10:53]
1
From what I understand, you intend to access the variable of each array and "mount" a time.
const arrayHora = [10]
const arrayMinuto = [53]
var horario = arrayHora[0] + ":" + arrayMinuto[0]
console.log(horario)
Remembering:
Browser other questions tagged javascript react react-native
You are not signed in. Login or sign up in order to post.
This arrayHora/arrayMinuto will always have a single position?
– Max Ferreira
They will only have one position. Since it is only 1 input (actually 1 HOUR and 1 MINUTE)
– Gabriel Prediger
Please clarify your problem or provide additional details in order to highlight exactly what you need. The way it’s written these days it’s hard to tell exactly what you’re asking.
–
If each array will contain only one position, it makes no sense to use arrays. Anyway, if you really need to use arrays, you can also do it as follows: [...arrayHora, ...arrayMinuto]. Join(':')
– dfvc