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 دنبال می‌کنید

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

صفحه بندی