function p(variableInObject) {
let name = Object.keys(variableInObject)[0]
let value = variableInObject[name]
console.log(name, value)
}
let g = 5
p({g}) // g 5
// it even works with loops
for (let i = 0; i < 3; i++) {
p({i}) // i 0, then i 1, then i 2
}