F
Скинь код
Size: a a a
F
V
V
ИК
F
curl -X POST "https://httpbin.org/post" -H "accept: application/json"
V
V
V
V
𝐓
F
[['key1', 'value1'], ['key2', 'value2'], ...]
arr1.map((value, index) => [ value, arr2[index] ])
А8
const arr = [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ];
const obj = Object.fromEntries(arr);
console.log(obj); // { 0: "a", 1: "b", 2: "c" }
КК
𝐓
𝐓
𝐓
A
𝐓
{
const keys = [1, 2, 3]
const values = ['a', 'b', 'c']
const fromKeys = keys =>
keys.reduce((result, key, idx) => {
result[key] = values[idx]
return result
}, {})