JenMorgan / js-learning

0 stars 0 forks source link

Write a JavaScript function to convert an object into a list of `[key, value]` pairs #25

Open kartamyshev opened 4 years ago

JenMorgan commented 4 years ago
function condervToArr (obj) {
    const arr = [];
    for (const key in obj) {
        arr.push([key, obj[key]]);
    }
    return arr;
}