See above. This should probably just be getKeys.

Also, doesn't this take an obj, not an array? I hope you're not using this on arrays (one would assume their keys are already sequential).