diff --git a/javascript.md b/javascript.md index 463ff27..c653bc1 100644 --- a/javascript.md +++ b/javascript.md @@ -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 + +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(); diff --git a/linux.md b/linux.md index 5835dac..502c838 100644 --- a/linux.md +++ b/linux.md @@ -42,3 +42,10 @@ tar -zcvf foo.txt.tar.gz foo.txt tar -xvf foo.txt.tar.gz ``` +## Text Editor Options for Programmers + +```c +Sublime Text Atom GNU Emacs +Vim Gedit Notepadqq +Nano VsCode Brackets +```