Skip to content

Added Closures #116

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

Merged
merged 6 commits into from
Apr 9, 2017
Merged

Added Closures #116

merged 6 commits into from
Apr 9, 2017

Conversation

sunnypatel165
Copy link
Contributor

@sunnypatel165 sunnypatel165 commented Sep 9, 2016

Placing this after Currying because I feel they are related and often confused with each other.

readme.md Outdated
@@ -145,6 +146,34 @@ add2(10) // 12

```

##Closure

A very simplistic definition - A closure is a way of accessing a variable outside its scope.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the definitions are supposed to be simple so this goes without saying

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh heh

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haah. Cool, will take that off.

@stereobooster
Copy link

Closures are requirement for Currying.

@sunnypatel165
Copy link
Contributor Author

Hi, @jethrolarson @hemanth - any more comments or changes? This is hanging since 3 weeks now 😆

@amilajack
Copy link
Contributor

I think it would also be useful to add the difference between closures and lamdas (a lot of ppl seem to not know the difference between them)

readme.md Outdated


```js
var addTo = function(x) {
Copy link
Owner

@hemanth hemanth Sep 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const addTo = x => y => x + y;

@hemanth
Copy link
Owner

hemanth commented Oct 1, 2016

I think it would also be useful to add the difference between closures and lamdas

Would vote for that!

@hemanth
Copy link
Owner

hemanth commented Dec 23, 2016

Ping!

Added closure vs lambda as suggested.
@sunnypatel165
Copy link
Contributor Author

sunnypatel165 commented Apr 9, 2017

Couldn't finish this for a long time, sorry!
Check now @hemanth :)
PS - I really don't know why people get confused between lambdas and closures!
Clearly different things!

@hemanth
Copy link
Owner

hemanth commented Apr 9, 2017

Thanks!

@hemanth hemanth merged commit 273175d into hemanth:master Apr 9, 2017
## Closure

A closure is a way of accessing a variable outside its scope.
Formally, a closure is a technique for implementing lexically scopped named binding. It is a way of storing a function with an environment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/scopped/scoped/

Copy link
Owner

@hemanth hemanth Apr 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#149 !

@amirouche
Copy link

Tx!

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

Successfully merging this pull request may close these issues.

7 participants