In the Javascript Debug Console, when I set var someVariable = Object.keys(objectWithKeys)[0], the keys and object get set to a string

Please see the attached screenshots showing this reproducible behavior.

When I try to set most variables in the Javascript Debug Console, I am able to do so successfully, demonstrated when I set x in the screenshot. However, when I try to do this while referencing Object.keys(), strange behavior occurs and the variable name is evaluated as a String, and the Object’s keys are set to this String which happens to be the variable name.

Is there an explanation for this?

Showing issue when setting to index under keys array

Showing issue with Object.keys()