1
I have following Object:
let Filmes = [{
"Nome": "Harry Potter 1",
"Preco": "50"
},
{
"Nome": "Harry Potter 2",
"Preco": "60"
},
{
"Nome": "Harry Potter 3",
"Preco": "70"
}]
let Cliente = ["Harry Potter 1", "Harry Potter 3"]
let ValorFinal = ""
How I do using the array Cliente
to verify in which Filmes
the Cliente
want? And after doing this, return me the Preco
of the movie. The output of this would be:
Final value = 120
Because the Client wants the Harry Potter 1
and Harry Potter 3
.
If possible in vanilla JS please
Perfect! These Filter, Reduce and Map methods are a bit tricky. But they are extremely useful!
– Jackson