diff --git a/script.js b/script.js index 8e85ff1..a526a4c 100644 --- a/script.js +++ b/script.js @@ -1,5 +1,22 @@ function convert (data) { // Your code here + + //#1 + // cara cepet: + //return Object.entries(data) + + //#2 + //kalau kurang kerjaan: + var keys = Object.keys(data) + var values = Object.values(data) + var result = [] + + for (var i = 0; i < keys.length; i++){ + result.push([keys[i], values[i]]) + } + + return result + } // TEST CASES