Create an array of key-value pair arrays from a given object

You have misunderstood what obj[k] does.

Read this < https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/accessing-object-properties-with-bracket-notation>