In brief
Inherited properties do not automatically enter the list.
Useful to know
Object.keys() returns an array of names of its own enumerable properties with string keys. In {name: "Ana", city: "Ruse"}, you get ["name", "city"]. This is a list of names, not values . [1]
It is suitable for a predefined object with settings. Do not use the number of keys as proof of a correct scheme: an object with two inappropriate fields also has a length 2. If the order of display is important for the product, set it explicitly, instead of relying on a randomly convenient arrangement of the input.
Sources
For further detail and to check the information: