How to do the Procv function of excel in javascript;
Ex:
I have a table with 2 columns (name and code) and I have a list with only names, I need to go through this list with names and bring the code corresponding to each name according to my table quoted above.
Table
Nome Codigo
João 340
Lucas 200
Tiago 120
List
['João','Lucas','Tiago']
I need to bring the corresponding codes to each name in this list.
I have a bottleneck in the following situation
I have 2 different json's with 1 property in common. In this case both have a number in common. I need to check if the Json2 number is the same as Json 1, if they are the same I need to display Number and Name of Json2 and Code of Json1.
Json1 = [{"Codigo":1233123,"Numero":12345},
{"Codigo":5345345,"Numero":45678},
{"Codigo":34234,"Numero":8907},
{"Codigo":423453,"Numero":340}]
Json2 = [{"Numero":12345,"Nome":'Tiago'},
{"Numero":45678,"Nome":'Joao'},
{"Numero":8907,"Nome":'Paulo'},
{"Numero":340,"Nome":'Maria'}]