1

I've spent about 20 minutes trying to find more information on the keys function in javascript...

I initially found the keys() function referenced in this answer:

Length of a JavaScript object

hash = {"a" : "b", "c": "d"};
keys(hash); // ["a", "c"]

Does anyone have any more information on this function, especially browser support?

4
  • You are probably looking for this: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… Commented Sep 3, 2015 at 11:22
  • That's not what I'm looking for Jonathan, Im looking for the documentation for the keys() function not the Object.keys() method or the Array.keys() method. Commented Sep 3, 2015 at 13:08
  • Well, look no further. There is no such function in JavaScript. Commented Sep 3, 2015 at 16:21
  • lol :) thanks Jonathon Commented Sep 3, 2015 at 16:22

1 Answer 1

2

There's no such function, it's part of the console api

Description for chrome console: https://developer.chrome.com/devtools/docs/commandline-api#keysobject

For Firefox: https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Helpers

Sign up to request clarification or add additional context in comments.

7 Comments

Yep, I've since tried this in a script and it throws Uncaught ReferenceError: keys is not defined
@Andrey, please don't answer documentation requests like these. Questions like this should be closed as off-topic.
This is not a documentation request. This isn't a JavaScript function and that's why there isn't any documentation. So it's a valid question and the answer is valid, although perhaps the answer could be more explicit, (that would be a bit pedantic though). However, I will delete this question if you think that it should be deleted. @Cerbrus
From your question: "Where's the documentation?"
@Cerbrus shoud I delete? Am happy to delete if that's your recommendation.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.