Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention _.VERSION in the documentation #2992

Open
clanceyp opened this issue Mar 14, 2024 · 3 comments
Open

Mention _.VERSION in the documentation #2992

clanceyp opened this issue Mar 14, 2024 · 3 comments
Labels
documentation starter good choice for new contributors

Comments

@clanceyp
Copy link

Add an alias, or method, for VERSION const e.g. '_.UNDERSCORE_VERSION' or _.version() ==> "Underscore v.X.XX.X" to allow users to determine if Underscore is being used and if so which version.

@jgonggrijp
Copy link
Collaborator

@clanceyp It is already accessible as _.VERSION. I now realize it isn't mentioned in the documentation, though. Will label and retitle accordingly. Thanks for bringing it up!

@jgonggrijp jgonggrijp added documentation starter good choice for new contributors labels Mar 14, 2024
@jgonggrijp jgonggrijp changed the title Add alias to VERSION const Mention _.VERSION in the documentation Mar 14, 2024
@clanceyp
Copy link
Author

What I want to know is whether it's the Underscore library or a different library using the "_" character alias.

@jgonggrijp
Copy link
Collaborator

Are you aware of other libraries than Underscore or Lodash that use _?

If you only need to distinguish between those two, you can use feature detection. Lodash has _.partialRight, Underscore does not. Underscore has _.restArguments, Lodash does not (at least not in version 4+). There are many other differences as well.

Also, if the major version number is 1, you are much more likely dealing with Underscore than Lodash, since Lodash is currently at 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation starter good choice for new contributors
Projects
None yet
Development

No branches or pull requests

2 participants