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

ES5 Constants example is overcomplicated #10

Closed
RReverser opened this issue Apr 5, 2015 · 1 comment
Closed

ES5 Constants example is overcomplicated #10

RReverser opened this issue Apr 5, 2015 · 1 comment

Comments

@RReverser
Copy link

In fact,

var PI = (function () {
    var PI = 3.141593;
    return function () { return PI; };
})();

could be reduced to

var PI = function () {
  return 3.141593;
};

and it would have totally same effect, while being simpler and faster.

rse added a commit that referenced this issue Apr 5, 2015
@rse
Copy link
Owner

rse commented Apr 5, 2015

Good catch. You're right, of course. Now fixed.

@rse rse closed this as completed Apr 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants