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

Identify functions - self, always false, always empty, etc #26

Open
coolaj86 opened this issue Mar 8, 2022 · 0 comments
Open

Identify functions - self, always false, always empty, etc #26

coolaj86 opened this issue Mar 8, 2022 · 0 comments
Labels
std Extends the Standard Library

Comments

@coolaj86
Copy link
Collaborator

coolaj86 commented Mar 8, 2022

  • Function._noop does nothing (return is not defined)
  • String._empty returns an empty string
  • Boolean._false always returns false
  • Boolean._true always returns true
  • Boolean._invert always returns the opposite
  • Object._self always returns the input
    (an identity function like Object itself, but for all types)
  • Object._null always returns null

There are other functions that make sense to include, but that I don't think I've actually found use for:

  • Number._zero
  • Is Boolean._false redundant with Function._noop?
Function._noop = function () {};
Boolean._false = function () { return false; };
Boolean._true = function () { return true; };
Object._self = function (val) { return val; };
@coolaj86 coolaj86 added the std Extends the Standard Library label Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
std Extends the Standard Library
Projects
None yet
Development

No branches or pull requests

1 participant