From 6bad088306daea78b62c8c7e1f69520d6d2cdec4 Mon Sep 17 00:00:00 2001 From: Ryan Souza <76923948+Ryrden@users.noreply.github.com> Date: Tue, 4 Oct 2022 20:37:21 -0300 Subject: [PATCH] Added content to Javascript This keyword (#1990) * blank spaces removed in existing files * Added content to javascript this keyword * Update content/roadmaps/106-javascript/content/111-javascript-this-keyword/100-function-borrowing.md * Update content/roadmaps/106-javascript/content/111-javascript-this-keyword/100-function-borrowing.md * Update content/roadmaps/106-javascript/content/111-javascript-this-keyword/100-function-borrowing.md * Update content/roadmaps/106-javascript/content/111-javascript-this-keyword/102-this-in-a-function.md * Update content/roadmaps/106-javascript/content/111-javascript-this-keyword/103-using-this-alone.md * Update content/roadmaps/106-javascript/content/111-javascript-this-keyword/104-this-in-event-handlers.md * Update content/roadmaps/106-javascript/content/111-javascript-this-keyword/105-this-in-arrow-functions.md Co-authored-by: Kamran Ahmed --- .../100-what-is-javascript.md | 3 +-- .../101-history-of-javascript.md | 5 +---- .../102-javascript-versions.md | 4 +--- .../103-how-to-run-javascript.md | 3 --- .../100-variable-declarations/100-var.md | 3 --- .../101-javascript-variables/102-naming-rules.md | 2 -- .../101-value-comparison-operators.md | 2 +- .../100-function-borrowing.md | 3 ++- .../102-this-in-a-function.md | 9 ++++++++- .../103-using-this-alone.md | 9 ++++++++- .../104-this-in-event-handlers.md | 7 ++++++- .../105-this-in-arrow-functions.md | 7 ++++++- .../106-explicit-binding.md | 10 +++------- .../content/111-javascript-this-keyword/readme.md | 3 +-- 14 files changed, 38 insertions(+), 32 deletions(-) diff --git a/content/roadmaps/106-javascript/content/100-javascript-introduction/100-what-is-javascript.md b/content/roadmaps/106-javascript/content/100-javascript-introduction/100-what-is-javascript.md index 007c477e0..fc2389719 100644 --- a/content/roadmaps/106-javascript/content/100-javascript-introduction/100-what-is-javascript.md +++ b/content/roadmaps/106-javascript/content/100-javascript-introduction/100-what-is-javascript.md @@ -1,6 +1,6 @@ # What is JavaScript? -JavaScript, often abbreviated JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. It lets us add interactivity to pages e.g. you might have seen sliders, alerts, click interactions, popups, etc on different websites -- all of that is built using JavaScript. Apart from being used in the browser, it is also used in other non-browser environments as well such as Node.js for writing server-side code in JavaScript, Electron for writing desktop applications, React Native for mobile applications, and so on. +JavaScript, often abbreviated JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. It lets us add interactivity to pages e.g. you might have seen sliders, alerts, click interactions, popups, etc on different websites -- all of that is built using JavaScript. Apart from being used in the browser, it is also used in other non-browser environments as well such as Node.js for writing server-side code in JavaScript, Electron for writing desktop applications, React Native for mobile applications, and so on. Free Content JavaScript MDN Docs @@ -10,4 +10,3 @@ JavaScript, often abbreviated JS, is a programming language that is one of the c Exploring JS: JavaScript books for programmers JavaScript Crash Course for Beginners Build a Netflix Landing Page Clone with HTML, CSS & JS - diff --git a/content/roadmaps/106-javascript/content/100-javascript-introduction/101-history-of-javascript.md b/content/roadmaps/106-javascript/content/100-javascript-introduction/101-history-of-javascript.md index 0a30ca884..e4c9ffeb2 100644 --- a/content/roadmaps/106-javascript/content/100-javascript-introduction/101-history-of-javascript.md +++ b/content/roadmaps/106-javascript/content/100-javascript-introduction/101-history-of-javascript.md @@ -4,7 +4,4 @@ JavaScript was initially created by Brendan Eich of NetScape and was first annou Free Content Brief History of JavaScript -The History of JavaScript - - - +The History of JavaScript \ No newline at end of file diff --git a/content/roadmaps/106-javascript/content/100-javascript-introduction/102-javascript-versions.md b/content/roadmaps/106-javascript/content/100-javascript-introduction/102-javascript-versions.md index baaedaa17..37c0f2709 100644 --- a/content/roadmaps/106-javascript/content/100-javascript-introduction/102-javascript-versions.md +++ b/content/roadmaps/106-javascript/content/100-javascript-introduction/102-javascript-versions.md @@ -4,6 +4,4 @@ JavaScript was invented by Brendan Eich, and in 1997 and became an ECMA standard Free Content JavaScript Versions: How JavaScript has changed over the years -Brief History of JavaScript - - +Brief History of JavaScript \ No newline at end of file diff --git a/content/roadmaps/106-javascript/content/100-javascript-introduction/103-how-to-run-javascript.md b/content/roadmaps/106-javascript/content/100-javascript-introduction/103-how-to-run-javascript.md index 3d849d042..f90631800 100644 --- a/content/roadmaps/106-javascript/content/100-javascript-introduction/103-how-to-run-javascript.md +++ b/content/roadmaps/106-javascript/content/100-javascript-introduction/103-how-to-run-javascript.md @@ -6,6 +6,3 @@ JavaScript can be run in the browser by including the external script file using How To Add JavaScript to HTML How To Write Your First JavaScript Program How To Use the JavaScript Developer Console - - - diff --git a/content/roadmaps/106-javascript/content/101-javascript-variables/100-variable-declarations/100-var.md b/content/roadmaps/106-javascript/content/101-javascript-variables/100-variable-declarations/100-var.md index c53acaf28..8593ec9d4 100644 --- a/content/roadmaps/106-javascript/content/101-javascript-variables/100-variable-declarations/100-var.md +++ b/content/roadmaps/106-javascript/content/101-javascript-variables/100-variable-declarations/100-var.md @@ -8,6 +8,3 @@ The var statement declares a function-scoped or globally-scoped variable, option JavaScript Variables - W3Schools Declaring Variables without Var, Let, Const - What Would Happen? How to declare variables in different ways in JavaScript? - - - diff --git a/content/roadmaps/106-javascript/content/101-javascript-variables/102-naming-rules.md b/content/roadmaps/106-javascript/content/101-javascript-variables/102-naming-rules.md index 60fe29cb5..22bdfbab5 100644 --- a/content/roadmaps/106-javascript/content/101-javascript-variables/102-naming-rules.md +++ b/content/roadmaps/106-javascript/content/101-javascript-variables/102-naming-rules.md @@ -7,5 +7,3 @@ A variable name should accurately identify your variable. When you create good v Naming JavaScript Variables JavaScript Naming Conventions Google JavaScript Style Guide - - diff --git a/content/roadmaps/106-javascript/content/105-javascript-equality-comparisons/101-value-comparison-operators.md b/content/roadmaps/106-javascript/content/105-javascript-equality-comparisons/101-value-comparison-operators.md index e6a5834bf..7a493d1ae 100644 --- a/content/roadmaps/106-javascript/content/105-javascript-equality-comparisons/101-value-comparison-operators.md +++ b/content/roadmaps/106-javascript/content/105-javascript-equality-comparisons/101-value-comparison-operators.md @@ -8,4 +8,4 @@ In javascript, the `==` operator does the type conversion of the operands before Free Content The Difference Between == and === in Javascript -Equality comparisons and sameness - MDN +Equality comparisons and sameness - MDN \ No newline at end of file diff --git a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/100-function-borrowing.md b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/100-function-borrowing.md index d84e74173..97e1a8731 100644 --- a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/100-function-borrowing.md +++ b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/100-function-borrowing.md @@ -2,4 +2,5 @@ Function borrowing allows us to use the methods of one object on a different object without having to make a copy of that method and maintain it in two separate places. It is accomplished through the use of `.call()`, `.apply()`, or `.bind()`, all of which exist to explicitly set this on the method we are borrowing. -Function borrowing +Free Content +Function borrowing \ No newline at end of file diff --git a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/102-this-in-a-function.md b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/102-this-in-a-function.md index cf4e1d757..138c4b9a5 100644 --- a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/102-this-in-a-function.md +++ b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/102-this-in-a-function.md @@ -1 +1,8 @@ -# This in a function \ No newline at end of file +# this in a function + +The keyword `this` when used in a function refers to the global object. + +*Note: in a browser window the global object is the `window` object.* + +Free Content +this in a function \ No newline at end of file diff --git a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/103-using-this-alone.md b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/103-using-this-alone.md index aba0fade2..3bf11cb6b 100644 --- a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/103-using-this-alone.md +++ b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/103-using-this-alone.md @@ -1 +1,8 @@ -# Using this alone \ No newline at end of file +# Using this alone + +The keyword `this` when used alone refers to the global object. + +*Note: in a browser window the global object is the `window` object.* + +Free Content +this Alone \ No newline at end of file diff --git a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/104-this-in-event-handlers.md b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/104-this-in-event-handlers.md index cdc55614b..8337a1c2c 100644 --- a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/104-this-in-event-handlers.md +++ b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/104-this-in-event-handlers.md @@ -1 +1,6 @@ -# This in event handlers \ No newline at end of file +# this in event handlers + +The keyword `this` when used in an event handler refers to the element that received the event. + +Free Content +this in Event handlers \ No newline at end of file diff --git a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/105-this-in-arrow-functions.md b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/105-this-in-arrow-functions.md index 985f70c88..8de6ca89a 100644 --- a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/105-this-in-arrow-functions.md +++ b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/105-this-in-arrow-functions.md @@ -1 +1,6 @@ -# This in arrow functions \ No newline at end of file +# this in arrow functions + +The keyword `this` when used in an arrow function refers to the parent object. + +Free Content +this keyword and arrow function \ No newline at end of file diff --git a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/106-explicit-binding.md b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/106-explicit-binding.md index 71230cf89..4fbaf60f0 100644 --- a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/106-explicit-binding.md +++ b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/106-explicit-binding.md @@ -1,11 +1,7 @@ # Explicit binding -In this method, you can force a function to use a certain object as its this. Explicit Binding can be applied using call(), apply(), and bind(). - -call(): Pass in the required object as the first parameter during the function call. The actual parameters are passed after the object. - -apply(): Similar to call() with a difference in the way the actual arguments are passed. Here, the actual arguments are passed as an array. - -bind(): In this method, you create a new function with a fixed this. These types of functions created using bind() are commonly known as bound functions. +Explicit binding is when you use the `call` or `apply` methods to explicitly set the value of `this` in a function. Explicit Binding can be applied using `call()`, `apply()`, and `bind()`. +Free Content Explicit Binding +Explicit Binding rule for this keyword diff --git a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/readme.md b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/readme.md index 1f3be6938..92ea791c9 100644 --- a/content/roadmaps/106-javascript/content/111-javascript-this-keyword/readme.md +++ b/content/roadmaps/106-javascript/content/111-javascript-this-keyword/readme.md @@ -10,5 +10,4 @@ In JavaScript, the `this` keyword is a little different compared to other langua - Methods like call(), apply(), and bind() can refer `this` to any object The JavaScript `this` Keyword -This Keyword - +This Keyword \ No newline at end of file