Re-mapping an array.

ساخت وبلاگ
Can anyone show me how I can re-map an array using the following criteria.

For example I have two arrays:
arr1 = [201,188,123,140,172,142,85,731];
arr2 = [3,0,7,1,2,4];
Code (JavaScript):
I wish to create a new array using the values on arr2 as the indexes on arr1.
For example arr1[arr2[0]] would be 140 and so on.

Final output of the new array would [140,201,731,188,123,172];

For a small amount of numbers I could use push but arr1 and arr2 could potentially have a lot of numbers....

Re-mapping an array. WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 235 تاريخ : شنبه 25 تير 1401 ساعت: 14:07