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

The fundamental defination and it's example has been added #136

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,22 @@ throw "Error message"; // throw error text to user
|g| Performs a global match and finds all|
|i| Performs case-insensitive matching|
|m| Performs multiline matching|

## Closures
Copy link
Member

Choose a reason for hiding this comment

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

Could you please wite this as a post instead?

Copy link
Author

Choose a reason for hiding this comment

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

Can you pl elaborate

Copy link
Member

Choose a reason for hiding this comment

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

This is a very specific use-case, and does not belong in Cheat Sheets, please write this as a post instead here https://onecompiler.com/posts


A closure is the combination of a function bundled together (enclosed) with references
to its surrounding state (the lexical environment). In other words, a closure gives you
access to an outer function's scope from an inner function. In JavaScript, closures are
created every time a function is created, at function creation time.

### Example
```c
function makeFunc() {
const name = 'Mozilla';
function displayName() {
console.log(name);
}
return displayName;
}
const myFunc = makeFunc();
myFunc();
7 changes: 7 additions & 0 deletions linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ tar -zcvf foo.txt.tar.gz foo.txt
tar -xvf foo.txt.tar.gz

```
## Text Editor Options for Programmers
Copy link
Member

Choose a reason for hiding this comment

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

Please add vm/ nano commands instead this list


```c
Sublime Text Atom GNU Emacs
Vim Gedit Notepadqq
Nano VsCode Brackets
```