why does Object.keys(array) return the indexes as a string, and keys(array) returns them as numbers?

Solution for why does Object.keys(array) return the indexes as a string, and keys(array) returns them as numbers?
is Given Below:

for example:

greetings = ['hey','hi','hello']

Object.keys(greetings) // ["0", "1", "2"]

BUT

keys(greetings) // [0, 1, 2]

You are trying the command line API’s keys, which isn’t actually part of standard JavaScript. It’s something Chromium-based browsers inject in DevTools.

As for why it returns different results, not sure. On the other hand, in JavaScript, indexing with a number is identical to indexing with the string version of that number, so it doesn’t really matter.