var replaceArr = ['A','J','Q',10,2];
var originalArr = [{A:0},{2:1},{3:2},{4:3},{5:4},{6:5},{10:9},{J:10},{Q:11},{K:12}];
Within this code snippet are two arrays:
replaceArr
and originalArr
The task at hand is to compare the values in replaceArr
with those in originalArr
, extracting the corresponding keys from the latter to replace in the former.
After completion, replaceArr
should look like this: [0,10,11,9,1]
Your assistance in this matter is greatly appreciated.