From e9dd0942e1fcf0daa93efbecbe2116ae7d392a7c Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Wed, 5 Oct 2022 04:45:30 +0530 Subject: [PATCH] added content to - prototypal inheritance, implicti type casting, keyed collections, structured data, break continue, labeled statements, comparison operators, string operators, conditional operators (#2032) Co-authored-by: Kamran Ahmed --- .../101-object/101-prototypal-inheritance.md | 15 ++++++++++++++- .../102-implicit-type-casting.md | 5 ++++- .../101-keyed-collections/readme.md | 11 ++++++++++- .../102-structured-data/readme.md | 9 ++++++++- .../102-break-continue/100-labeled-statements.md | 7 +++++-- .../102-break-continue/readme.md | 11 +++++++---- .../101-omparison-operators.md | 5 +++-- .../106-string-operators.md | 6 ++++-- .../107-conditional-operators.md | 13 ++++++++++--- 9 files changed, 65 insertions(+), 17 deletions(-) diff --git a/content/roadmaps/106-javascript/content/102-javascript-datatypes/101-object/101-prototypal-inheritance.md b/content/roadmaps/106-javascript/content/102-javascript-datatypes/101-object/101-prototypal-inheritance.md index b0ceeed19..c1a1e418c 100644 --- a/content/roadmaps/106-javascript/content/102-javascript-datatypes/101-object/101-prototypal-inheritance.md +++ b/content/roadmaps/106-javascript/content/102-javascript-datatypes/101-object/101-prototypal-inheritance.md @@ -1 +1,14 @@ -# Prototypal inheritance \ No newline at end of file +# Prototypal inheritance + +In JavaScript, objects have a special hidden property `[[Prototype]]`, that is either null or references another object. That object is called "a prototype". + +When we read a property from object, and it's missing, JS automatically takes it from the prototype. This is called "protoypal inheritance". + +Syntax: + +`ChildObject.__proto__ = ParentObject` + +Free Content +JavaScript MDN Docs +GeeksForGeeks – JavaScript Tutorial +The Modern JavaScript Tutorial diff --git a/content/roadmaps/106-javascript/content/103-javascript-type-casting/102-implicit-type-casting.md b/content/roadmaps/106-javascript/content/103-javascript-type-casting/102-implicit-type-casting.md index 72d8ed288..870c59379 100644 --- a/content/roadmaps/106-javascript/content/103-javascript-type-casting/102-implicit-type-casting.md +++ b/content/roadmaps/106-javascript/content/103-javascript-type-casting/102-implicit-type-casting.md @@ -1,6 +1,9 @@ # Implicit Type Casting -Implicit type casting happens when JavaScript automatically converts one data type to another to meet the expectations of the process. as for example passing a number when it expects a string like `"foo" + 1`, the Number `1` is implicitly converted into a string and the expression returns `"foo1"`. +Implicit type conversion happens when the compiler or runtime automatically converts data types. JavaScript is loosely typed language and most of the time operators automatically convert a value to the right type. Free Content +GeeeksForGeeks - JavaScript Tutorials +W3Schools - JavaScript Tutorials +TutorialsPoint - JavaScript Tutorials What you need to know about Javascript's Implicit Coercion diff --git a/content/roadmaps/106-javascript/content/104-javascript-data-structures/101-keyed-collections/readme.md b/content/roadmaps/106-javascript/content/104-javascript-data-structures/101-keyed-collections/readme.md index 6c3bc427a..d44e43182 100644 --- a/content/roadmaps/106-javascript/content/104-javascript-data-structures/101-keyed-collections/readme.md +++ b/content/roadmaps/106-javascript/content/104-javascript-data-structures/101-keyed-collections/readme.md @@ -1 +1,10 @@ -# Keyed collections \ No newline at end of file +# Keyed collections + +Keyed collections are collections of data that are ordered by a key and not index. They are associative in nature. + +`Map` and `Set` objects contain elements which are iterable in the order of insertion. + +Free Content +JavaScript MDN Docs +Tutorialspoint – JavaScript Tutorial +Medium - Keyed Collections in JavaScript diff --git a/content/roadmaps/106-javascript/content/104-javascript-data-structures/102-structured-data/readme.md b/content/roadmaps/106-javascript/content/104-javascript-data-structures/102-structured-data/readme.md index 63e018c02..5c07be00f 100644 --- a/content/roadmaps/106-javascript/content/104-javascript-data-structures/102-structured-data/readme.md +++ b/content/roadmaps/106-javascript/content/104-javascript-data-structures/102-structured-data/readme.md @@ -1 +1,8 @@ -# Structured data \ No newline at end of file +# Structured data + +Structured data is used by search-engines, like Google, to understand the content of the page, as well as to gather information about the web and the world in general. + +It is also coded using in-page markup on the page that the information applies to. + +Free Content +Google Developers docs diff --git a/content/roadmaps/106-javascript/content/106-javascript-loops-iterations/102-break-continue/100-labeled-statements.md b/content/roadmaps/106-javascript/content/106-javascript-loops-iterations/102-break-continue/100-labeled-statements.md index c6d7954a7..92b95b500 100644 --- a/content/roadmaps/106-javascript/content/106-javascript-loops-iterations/102-break-continue/100-labeled-statements.md +++ b/content/roadmaps/106-javascript/content/106-javascript-loops-iterations/102-break-continue/100-labeled-statements.md @@ -1,6 +1,9 @@ # Labeled Statements -The labeled statement can be used with `break` or `continue` statements. It is prefixing a statement with an identifier that you can refer to. +JavaScript label statements are used to prefix a label to an identifier. It can be used with `break` and `continue` statement to control the flow more precisely. + +A label is simply an identifier followed by a colon`(:)` that is applied to a block of code. Free Content -Label Statements +JavaScript MDN Docs +Tutorialspoint – JavaScript Tutorial \ No newline at end of file diff --git a/content/roadmaps/106-javascript/content/106-javascript-loops-iterations/102-break-continue/readme.md b/content/roadmaps/106-javascript/content/106-javascript-loops-iterations/102-break-continue/readme.md index 34f95efba..f7e85e57a 100644 --- a/content/roadmaps/106-javascript/content/106-javascript-loops-iterations/102-break-continue/readme.md +++ b/content/roadmaps/106-javascript/content/106-javascript-loops-iterations/102-break-continue/readme.md @@ -1,7 +1,10 @@ -# Break Continue +# Break continue -The `break` and `continue` statements are used to "jump out" of a loop. When executed, the `break` statement will terminate the loop entirely; Whereas `continue` will terminate only the current iteration, and continue execution of the loop's next iteration. +`break` statement, without a label reference, can only be used to jump out of a loop or a switch block. + +`continue` statement, with or without a label reference, can only be used to skip one loop iteration. Free Content -break -continue \ No newline at end of file +JavaScript MDN Docs - continue statement +JavaScript MDN Docs - break statement +W3Schools – JavaScript Tutorial diff --git a/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/101-omparison-operators.md b/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/101-omparison-operators.md index 7d11538f9..1ef92c0c2 100644 --- a/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/101-omparison-operators.md +++ b/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/101-omparison-operators.md @@ -1,7 +1,8 @@ # Comparison Operators -Comparison operators are the operators that compare values and return true or false. -The operators include : `>`, `<`, `>=`, `<=`, `==`, `===`, `!==` and `!===` +Comparison operators are the operators that compare values and return true or false. The operators include: `>`, `<`, `>=`, `<=`, `==`, `===`, `!==` and `!===` Free Content +W3Schools - JavaScript Tutorials +JavaScript MDN Docs Comparison operators diff --git a/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/106-string-operators.md b/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/106-string-operators.md index d545ab479..fbaf7fbbb 100644 --- a/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/106-string-operators.md +++ b/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/106-string-operators.md @@ -1,7 +1,9 @@ # String Operators -Strings are useful for holding data that can be represented in text form. Some of the most-used operators on strings are to build and concatenate them using this string operators: `+` (Concatenate), `+=` (Concatenate Assignment). +In addition to the comparison operators, which can be used on string values, the concatenation operator (`+`) concatenates two string values together, returning another string that is the union of the two operand strings. + +The shorthand assignment operator `+=` can also be used to concatenate strings. Free Content -Arithmetic Operators - MDN +JavaScript MDN Tutorials String Concatenation - JavaScript.info \ No newline at end of file diff --git a/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/107-conditional-operators.md b/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/107-conditional-operators.md index c17a388b3..3ee79e51a 100644 --- a/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/107-conditional-operators.md +++ b/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/107-conditional-operators.md @@ -1,6 +1,13 @@ -# Conditional Operators +# Conditional operators -The conditional operator (or "ternary" operator) is a shorthand `if...else` statement. The syntax is: `condition ? expression1 : expression2;`. That is, the operator will execute `expression1` if the condition is `truthy`, and otherwise `expression2` if the condition is `falsy`. +Conditional oprator also known as Ternary operator is the only JS operator that takes three operands. + +The operator can have one of two values based on a condition. + +Syntax: + +`condition ? val_for_true : val_for_false ` Free Content -Conditional Operator +JavaScript MDN Docs +W3Schools - JavaScript Tutorials