├── Front-End-Development-Certification ├── Basic-JavaScript │ ├── Lesson-Apply-Angularjs-Directives.md │ ├── Lesson-Create-Angularjs-Services.md │ ├── Lesson-Manipulate-Arrays-With-shift().md │ ├── Lesson-Nest-one-Array-within-Another-Array.md │ ├── Lesson-Manipulate-Arrays-With-unshift().md │ ├── Lesson-Multiply-Two-Numbers-with-JavaScript.md │ ├── Lesson-Divide-One-Decimal-by-Another-with-JavaScript.md │ ├── Lesson-Divide-One-Number-by-Another-with-JavaScript.md │ ├── Lesson-Find-Whitespace-with-Regular-Expressions.md │ ├── Lesson-Multiply-Two-Decimals-with-JavaScript.md │ ├── Lesson-Add-Two-Numbers-with-JavaScript.md │ ├── Lesson-Declare-String-Variables.md │ ├── Lesson-Manipulate-Arrays-With-push().md │ ├── Lesson-Add-New-Properties-to-a-JavaScript-Object.md │ ├── Lesson-Subtract-One-Number-from-Another-with-JavaScript.md │ ├── Lesson-Assignment-with-Times-Equals.md │ ├── Lesson-Modify-Array-Data-With-Indexes.md │ ├── Lesson-Assignment-with-Divided-by-Equals.md │ ├── Lesson-Assignment-with-Minus-Equals.md │ ├── Lesson-Use-Bracket-Notation-to-Find-the-Nth-to-Last-Character-in-a-String.md │ ├── Lesson-Invert-Regular-Expression-Matches-with-JavaScript.md │ ├── Lesson-Check-the-Length-Property-of-a-String-Variable.md │ ├── Lesson-Declare-JavaScript-Variables.md │ ├── Lesson-Generate-Random-Fractions-with-JavaScript.md │ ├── Lesson-Find-Numbers-with-Regular-Expressions.md │ ├── Lesson-Increment-a-Number-with-Javascript.md │ ├── Lesson-Decrement-a-Number-with-Javascript.md │ ├── Lesson-Manipulate-Arrays-With-pop().md │ ├── Lesson-Iterate-with-JavaScript-While-Loops.md │ ├── Lesson-Appending-Variables-to-Strings.md │ ├── Lesson-Find-the-Length-of-a-String.md │ ├── Lesson-Initializing-Variables-with-the-Equal-Operator.md │ ├── Lesson-Understand-String-Immutability.md │ ├── Lesson-Use-Bracket-Notation-to-Find-the-Nth-Character-in-a-String.md │ ├── Lesson-Access-Array-Data-with-Indexes.md │ ├── Lesson-Chaining-If-Else-Statements.md │ ├── Lesson-Generate-Random-Whole-Numbers-with-JavaScript.md │ ├── Lesson-Introducing-Else-If-Statements.md │ ├── Lesson-Create-Decimal-Numbers-with-JavaScript.md │ ├── Lesson-Write-Reusable-JavaScript-with-Functions.md │ ├── Lesson-Iterate-over-Arrays-with-map.md │ ├── Lesson-Constructing-Strings-with-Variables.md │ ├── Lesson-Store-Multiple-Values-in-one-Variable-using-JavaScript-Arrays.md │ ├── Lesson-Understand-Boolean-Values.md │ ├── Lesson-Use-Bracket-Notation-to-Find-the-Last-Character-in-a-String.md │ ├── Lesson-Customize-Angularjs-Directives.md │ ├── Lesson-Introducing-Else-Statements.md │ ├── Lesson-Storing-Values-with-the-Equal-Operator.md │ ├── Lesson-Return-A-Value-From-A-Function-With-Return.md │ ├── Lesson-Comparison-With-The-Strict-Equality-Operator.md │ ├── Lesson-Comparison-With-The-Strict-Inequality-Operator.md │ ├── Lesson-Iterate-Odd-Numbers-With-a-For-Loop.md │ ├── Lesson-Concatenating-Strings-with-Plus-Operator.md │ ├── Lesson-Understanding-Uninitialized-Variables.md │ ├── Lesson-Global-Vs-Local-Scope-In-Functions.md │ ├── Lesson-Assignment-with-Plus-Equals.md │ ├── Lesson-Comparison-With-The-Less-Than-Operator.md │ ├── Lesson-Build-JavaScript-Objects.md │ ├── Lesson-Comparison-With-The-Greater-Than-Operator.md │ ├── Lesson-Global-Scope-And-Functions.md │ ├── Lesson-Comparison-With-The-Inequality-Operator.md │ ├── Lesson-Concatenating-Strings-with-the-Plus-Equals-Operator.md │ ├── Lesson-Local-Scope-And-Functions.md │ ├── Lesson-Return-Early-Pattern-For-Functions.md │ ├── Lesson-Escape-Sequences-in-Strings.md │ ├── Lesson-Escaping-Literal-Quotes-in-Strings.md │ ├── Lesson-Testing-Objects-For-Properties.md │ ├── Lesson-Comparison-With-The-Greater-Than-Equal-To-Operator.md │ ├── Lesson-Assignment-With-A-Returned-Value.md │ ├── Lesson-Comment-your-JavaScript-Code.md │ ├── Lesson-Count-Backwards-With-a-For-Loop.md │ ├── Lesson-Use-Bracket-Notation-to-Find-the-First-Character-in-a-String.md │ ├── Lesson-Accessing-Objects-Properties-With-The-Dot-Operator.md │ ├── Lesson-Comparison-With-The-Less-Than-Equal-To-Operator.md │ ├── Lesson-Access-Multi-Dimensional-Arrays-With-Indexes.md │ ├── Lesson-Accessing-Nested-Objects-In-JSON.md │ ├── Lesson-Finding-a-Remainder-in-Javascript.md │ ├── Lesson-Replacing-If-Else-Chains-With-Switch.md │ ├── Lesson-Using-Objects-For-Lookups.md │ ├── Lesson-Multiple-Identical-Options-In-Switch-Statements.md │ ├── Lesson-Accessing-Nested-Arrays-In-JSON.md │ ├── Lesson-Comparisons-With-The-Logical-Or-Operator.md │ ├── Lesson-Iterate-Through-An-Array-With-A-For-Loop.md │ ├── Lesson-Adding-A-Default-Option-In-Switch-Statements.md │ ├── Lesson-Quoting-Strings-with-Single-Quotes.md │ ├── Lesson-Accessing-Objects-Properties-With-Bracket-Notation.md │ ├── Lesson-Nesting-For-Loops.md │ ├── Lesson-Accessing-Objects-Properties-With-Variables.md │ ├── Lesson-Returning-Boolean-Values-From-Functions.md │ ├── Lesson-Comparisons-With-The-Logical-And-Operator.md │ ├── Lesson-Convert-JSON-Data-to-HTML.md │ ├── Lesson-Sift-through-Text-with-Regular-Expressions.md │ ├── Lesson-Change-Text-Inside-an-Element-Using-jQuery.md │ ├── Lesson-Updating-Object-Properties.md │ ├── Lesson-Understanding-Case-Sensitivity-in-Variables.md │ ├── Lesson-Selecting-From-Many-Options-With-Switch-Statements.md │ ├── Lesson-Introducing-Javascript-Object-Notation-Json.md │ ├── Lesson-Passing-Values-To-Functions-With-Arguments.md │ ├── Lesson-Delete-Properties-from-a-JavaScript-Object.md │ ├── Lesson-Power-Forms-with-Angularjs.md │ ├── Lesson-Comparison-With-The-Equality-Operator.md │ ├── Lesson-Review-Template.md │ ├── Lesson-Iterate-with-JavaScript-For-Loops.md │ ├── Lesson-Use-Conditional-Logic-with-If-Statements.md │ ├── Lesson-Review-Shopping-List.md │ └── Lesson-Review-Convert-Celsius-to-Fahrenheit.md ├── Object-Oriented-And-Functional-Programming │ ├── Lesson-Concatenate-Strings-with-concat.md │ ├── Lesson-Reverse-Arrays-with-reverse.md │ ├── Lesson-Split-Strings-with-split.md │ ├── Lesson-Join-Strings-with-join.md │ ├── Lesson-Sort-Arrays-with-sort.md │ ├── Lesson-Filter-Arrays-with-filter.md │ ├── Lesson-Condense-arrays-with-reduce.md │ ├── Lesson-Construct-JavaScript-Objects-with-Functions.md │ ├── Lesson-Declare-JavaScript-Objects-as-Variables.md │ ├── Lesson-Make-Unique-Objects-by-Passing-Parameters-to-our-Constructor.md │ ├── Lesson-Make-Instances-of-Objects-with-a-Constructor-Function.md │ └── Lesson-Make-Object-Properties-Private.md ├── JSON-Ajax │ ├── Lesson-Change-Text-with-Click-Events.md │ ├── Lesson-Render-Images-from-Data-Sources.md │ ├── Lesson-Prefilter-JSON.md │ ├── Lesson-Trigger-Click Events-with-jQuery.md │ ├── Lesson-Get-JSON-with-the-jQuery-getJSON-Method.md │ └── Lesson-Get-Geo-location-Data.md ├── Basic-Algorithm-Scripting │ ├── Bonfire-Meet-Bonfire.md │ ├── Bonfire-Slasher-Flick.md │ ├── Bonfire-Reverse-a-String.md │ ├── Bonfire-Confirm-the-Ending.md │ ├── Bonfire-Falsey-Bouncer.md │ ├── Bonfire-Repeat-a-string-repeat-a-string.md │ ├── Bonfire-Chunky-Monkey.md │ ├── Bonfire-Truncate-a-string.md │ ├── Bonfire-Factorialize-a-Number.md │ ├── Bonfire-Find-the-Longest-Word-in-a-String.md │ ├── Bonfire-Check-for-Palindromes.md │ ├── Bonfire-Where-do-I-belong.md │ ├── Bonfire-Title-Case-a-Sentence.md │ ├── Bonfire-Seek-and-Destroy.md │ └── Bonfire-Return-Largest-Numbers-in-Arrays.md ├── Basic-Fron-End-Projects │ └── Lesson-Get-Set-for-Ziplines.md └── Intermediate-Algorithm-Scripting │ ├── Bonfire-Boo-who.md │ ├── Bonfire-Drop-it.md │ └── Bonfire-Spinal-Tap-Case.md ├── _Footer.md ├── Back-End-Development-Certification ├── Automated-Testing-And-Debugging │ ├── Lesson-Using-typeof.md │ └── Lesson-Use-the-Javascript-Console.md ├── Express │ ├── Build-Web-Apps-With-Express.md │ ├── Express-App-Hello-World.md │ ├── Express-App-Whats-In-Query.md │ ├── Express-App-Static.md │ ├── Express-App-Jademd │ ├── Express-App-JSON-Me.md │ ├── Express-App-Stylish-CSS.md │ └── Express-App-Param-Pam-Pam.md └── MongoDB │ ├── Store-Data-In-MongoDB.md │ ├── MongoDB-Mongod.md │ ├── MongoDB-Connect.md │ ├── MongoDB-Remove.md │ ├── MongoDB-Count.md │ ├── MongoDB-Rounding.md │ ├── MongoDB-Find-Project.md │ ├── MongoDB-Update.md │ └── MongoDB-Aggregate.md ├── Templates └── Lesson-Template.md ├── MangaDB.md └── Angular └── Lesson-Get-Started-with-Angular.js.md /Front-End-Development-Certification/Basic-JavaScript/Lesson-Apply-Angularjs-Directives.md: -------------------------------------------------------------------------------- 1 | # Filters 2 | Dem videos sucks! 3 | -------------------------------------------------------------------------------- /_Footer.md: -------------------------------------------------------------------------------- 1 | Thanks for visiting, if you like this please feel free to star my repo, follow me or even contact me about contributing as it will be a lot of work and having help would be cool. 2 | 3 | [Go Home!](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki#welcome) -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Create-Angularjs-Services.md: -------------------------------------------------------------------------------- 1 | To best organize the application modules, it is best to split Modules around functionality: 2 | - app.js - top level module attached via `ng-app` 3 | - product.js - all the functionality for products and only products. 4 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Manipulate-Arrays-With-shift().md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Manipulate Arrays With shift() 9 | `shift()` removes the first element unlike `pop()` which removes the last. 10 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Nest-one-Array-within-Another-Array.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Nest one Array within Another Array 9 | You can nest arrays within other arrays, like this:`[["Bulls", 43]]`. 10 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Manipulate-Arrays-With-unshift().md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Manipulate Arrays With unshift() 9 | `myArray.unshift('Paul');` Basically you call `unshift` and pass what was deleted. 10 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Multiply-Two-Numbers-with-JavaScript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Multiply Two Numbers with JavaScript 9 | JavaScript uses use the `*` symbol for multiplication. 10 | 11 | `var product = 8 * 10;` 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Divide-One-Decimal-by-Another-with-JavaScript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Divide One Number by Another with JavaScript 9 | JavaScript uses use the `/` symbol for division. `var quotient = 4.4 / 2.0;` 10 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Divide-One-Number-by-Another-with-JavaScript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Divide One Number by Another with JavaScript 9 | JavaScript uses use the `/` symbol for division. `var quotient = 66 / 33;` 10 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Find-Whitespace-with-Regular-Expressions.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Find White Space with Regular Expressions 9 | We can also use selectors like`\s` to find spaces in a string. 10 | 11 | It is used like this: 12 | 13 | `/\s+/g` 14 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Multiply-Two-Decimals-with-JavaScript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Multiply Two Decimals with JavaScript 9 | In JavaScript, you can also perform calculations with decimal numbers, just like whole numbers. `var product = 2.0 * 0.0;` 10 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Concatenate-Strings-with-concat.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Concatenate Strings with concat 9 | `.concat()` can be used to merge the contents of two arrays into one. 10 | 11 | `array = array.concat(otherArray);` 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Add-Two-Numbers-with-JavaScript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Add Two Numbers with JavaScript 9 | JavaScript uses the `+` symbol for addition. It can also be used instead of `parseInt()` but that is beyond this. 10 | 11 | `var sum = 10 + 10;` 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Declare-String-Variables.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Declare String Variables 9 | A String variable. It is nothing more than a `"string"` of characters. JavaScript strings are always wrapped in quotes. 10 | 11 | `var myFirstName = 'Rafael';` 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Manipulate-Arrays-With-push().md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Manipulate Arrays With push() 9 | Not only can you `pop()` data off of the end of an array, you can also `push()` data onto the end of an array. 10 | 11 | `myArray.push(["dog", 3]);` 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Add-New-Properties-to-a-JavaScript-Object.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Add New Properties to a JavaScript Object 9 | 10 | You can add new properties to existing JavaScript objects the same way you would modify them. Here is how: `myDog.bark = "woof-woof";` 11 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Subtract-One-Number-from-Another-with-JavaScript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Subtract One Number from Another with JavaScript 9 | We can also subtract one number from another. 10 | 11 | JavaScript uses use the - symbol for subtraction. `var difference = 45 - 33;` 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Assignment-with-Times-Equals.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Assignment with Times Equals 9 | 10 | The `*= operator` multiplies a variable by a number. 11 | 12 | `myVar = myVar * 5;` 13 | 14 | will multiply `myVar` by `5`. This can be rewritten as: 15 | 16 | `myVar *= 5;` 17 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Modify-Array-Data-With-Indexes.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Modify Array Data With Indexes 9 | We can also modify the data stored in arrays by using indexes. 10 | 11 | For example: 12 | 13 | ```js 14 | var ourArray = [3,2,1]; 15 | ourArray[0] = 1; // equals [1,2,1] 16 | ``` 17 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Assignment-with-Divided-by-Equals.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Assignment with Divided by Equals 9 | The `/= operator` divides a variable by another number. 10 | 11 | `myVar = myVar / 5;` 12 | 13 | Will divide `myVar` by `5`. This can be rewritten as: 14 | 15 | `myVar /= 5;` 16 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Assignment-with-Minus-Equals.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Assignment with Minus Equals 9 | Like the `+= operator`, `-=` subtracts a number from a variable. 10 | 11 | `myVar = myVar - 5;` 12 | 13 | will subtract `5` from `myVar`. This can be rewritten as: 14 | 15 | `myVar -= 5;` 16 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Reverse-Arrays-with-reverse.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Reverse Arrays with reverse 9 | You can use the .reverse() function to reverse the contents of an array. 10 | 11 | ```js 12 | var array = [1,2,3,4,5,6,7]; 13 | 14 | array = array.reverse(); 15 | ``` 16 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Split-Strings-with-split.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Split Strings with split 9 | You can use the `.split()` method to split a string into an array. 10 | 11 | split uses the argument you give to to split the string. 12 | 13 | `array = string.split(' ');` 14 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Use-Bracket-Notation-to-Find-the-Nth-to-Last-Character-in-a-String.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Use Bracket Notation to Find the Nth-to-Last Character in a String 9 | You can get the value of the third-to-last letter of the `var firstName = "Charles"` string by using `firstName[firstName.length - 3]`. 10 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Join-Strings-with-join.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Join Strings with join 9 | We can use the `.join()` method to join each element in an array into a string separated by whatever delimiter you provide as an argument to the join operation. 10 | 11 | `var joinMe = joinMe.join(" ");` 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Invert-Regular-Expression-Matches-with-JavaScript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Invert Regular Expression Matches with JavaScript 9 | Use`/\S/gi`; to match everything that isn't a space in the string. 10 | 11 | You can invert any match by using the uppercase version of the selector `\s` versus `\S` for example. 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Check-the-Length-Property-of-a-String-Variable.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Check the Length Property of a String Variable 9 | _Data structures_ have properties. For example, strings have a property called `.length` that will tell you how many characters are in the string. 10 | 11 | `lastNameLength = lastName.length;` 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Declare-JavaScript-Variables.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Declare JavaScript Variables 9 | When we store data in a data structure, we call it a variable. JavaScript variables are written in `camel case`. An example of camel case is: `camelCase`. 10 | 11 | You can declare a variable this way `var myName = "Rafael";` 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Generate-Random-Fractions-with-JavaScript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Generate Random Fractions with JavaScript 9 | JavaScript has a `Math.random()` function that generates a random decimal number between `0` (inclusive) and not quite up to `1` (exclusive). Thus `Math.random()` can return a `0` but never quite return a `1`. 10 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Sort-Arrays-with-sort.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Sort Arrays with sort 9 | You can use the method sort to easily sort the values in the array alphabetically or numerically 10 | 11 | ```js 12 | var array = [1,3,2]; 13 | 14 | array = array.sort(); 15 | ``` 16 | 17 | This will return `[1, 2, 3]` 18 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Find-Numbers-with-Regular-Expressions.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Find Numbers with Regular Expressions 9 | We can use special selectors in Regular Expressions to select a particular type of value. 10 | 11 | One such selector is the digit selector `\d` which is used to grab the numbers in a string. 12 | 13 | It is used like this: `/\d+/g`. 14 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Increment-a-Number-with-Javascript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Increment a Number with Javascript 9 | You can easily increment or add `1` to a variable with the `++` operator. 10 | 11 | `i++;` 12 | 13 | is the equivalent of 14 | 15 | `i = i + 1;` 16 | 17 | **Note** The entire line becomes `i++;`, eliminating the need for the equal sign. 18 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Decrement-a-Number-with-Javascript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Decrement a Number with Javascript 9 | You can easily decrement or decrease a variable by `1` with the `--` operator. 10 | 11 | `i--;` 12 | 13 | is the equivalent of 14 | 15 | `i = i - 1;` 16 | 17 | **Note:** The entire line becomes `i--;`, eliminating the need for the equal sign. 18 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Manipulate-Arrays-With-pop().md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Manipulate Arrays With pop() 9 | Another way to change the data in an array is with the `.pop()` function. 10 | 11 | `.pop()` is used to "pop" a value off of the end of an array. We can retrieve this value by performing `pop()` in a variable declaration. 12 | 13 | Any type of variable can be "popped" off of an array. 14 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Iterate-with-JavaScript-While-Loops.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Iterate with JavaScript While Loops 9 | Another type of JavaScript loop is called a `while loop` because it runs `while` something is true, and stops once that something is no longer true. 10 | 11 | ```js 12 | var ourArray = []; 13 | var i = 0; 14 | while(i < 5) { 15 |   ourArray.push(i); 16 |   i++; 17 | } 18 | ``` 19 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Filter-Arrays-with-filter.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Filter Arrays with filter 9 | Filter is a useful method that can filter out values that don't match a certain criteria. 10 | 11 | ```js 12 | var array = [1,2,3,4,5,6,7,8,9,10]; 13 | // Only change code below this line. 14 | array = array.filter(function(val) { 15 | return val <= 5; 16 | }); 17 | ``` 18 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Appending-Variables-to-Strings.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Appending Variables to Strings 9 | Just as we can build a string over multiple lines out of string literals, we can also append variables to a string using the plus equals `+=` operator. 10 | 11 | ## Example 12 | 13 | ```js 14 | var anAdjective = "awesome!"; 15 | var ourStr = "Free Code Camp is "; 16 | ourStr += anAdjective; 17 | ``` 18 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/Automated-Testing-And-Debugging/Lesson-Using-typeof.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Use the Javascript Console 9 | You can use `typeof` to check the `data structure`, or type, of a variable. 10 | 11 | Note that in JavaScript, arrays are technically a type of object. 12 | 13 | ```js 14 | console.log(typeof("")); 15 | 16 | console.log(typeof(0)); 17 | 18 | console.log(typeof([])); 19 | 20 | console.log(typeof({})); 21 | ``` 22 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Find-the-Length-of-a-String.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Find the Length of a String 9 | You can find the _length_ of a String value by writing `.length` after the string variable or string literal. 10 | 11 | `"Alan Peter".length; // 10` 12 | 13 | For example, if we created a variable `var firstName = "Charles"`, we could find out how long the string "Charles" is by using the `firstName.length` property. 14 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Initializing-Variables-with-the-Equal-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Initializing Variables with the Equal Operator 9 | In most cases you will see a variable being declared and given an initial value all at the same time. This allows you to use it right away with a proper value. 10 | 11 | `var myVar = 0;` 12 | 13 | Creates a new variable called `myVar` and assigns it an initial value of `0 14 | `. 15 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Understand-String-Immutability.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Understand String Immutability 9 | In Javascript, String values are `immutable`, which means that they cannot be altered once created. 10 | 11 | ## Example 12 | 13 | ```js 14 | var myStr = "Bob"; 15 | myStr[0] = "J"; 16 | ``` 17 | 18 | Would not work, the only way would be: 19 | 20 | ```js 21 | var myStr = "Bob"; 22 | myStr = "Job"; 23 | ``` 24 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Use-Bracket-Notation-to-Find-the-Nth-Character-in-a-String.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Use Bracket Notation to Find the Nth Character in a String 9 | You can also use bracket notation to get the character at other positions within a string. 10 | 11 | Remember that computers start counting at `0`, so the first character is actually the zeroth character. 12 | 13 | `var thirdLetterOfLastName = lastName[2];` 14 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/JSON-Ajax/Lesson-Change-Text-with-Click-Events.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Change Text with Click Events 9 | When a click event happens, we can use Ajax to update an HTML element with the following code `$(".message").html("Here is the message");` 10 | 11 | This tells jQuery to use the class `message` as the selector and to that, change the HTML to have the string provide, we can also add custom html elements wrapped in quotation marks. 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/JSON-Ajax/Lesson-Render-Images-from-Data-Sources.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Render Images from Data Sources 9 | 10 | Obtaining image links from JSON objects has been explained already. However, how do you present that image as an actual image requires a bit of ingenuity, yet it is simple even if you don't figure it out yourself. You have to generate html using the variable to complete the link like this: `html += "";` 11 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Access-Array-Data-with-Indexes.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Access Array Data with Indexes 9 | We can access the data inside arrays using indexes. 10 | 11 | Array indexes are written in the same bracket notation that strings use, except that instead of specifying a character, they are specifying an entry in the array. 12 | 13 | ## Example 14 | 15 | ```js 16 | var array = [1,2,3]; 17 | array[0]; //equals 1 18 | var data = array[1]; 19 | ``` 20 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Chaining-If-Else-Statements.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Chaining If Else Statements 9 | `if/else` statements can be chained together for complex logic. Here is `pseudocode` of multiple chained `if` / `else if` statements: 10 | 11 | ```js 12 | if(condition1) { 13 | statement1 14 | } else if (condition2) { 15 | statement2 16 | } else if (condition3) { 17 | statement3 18 | . . . 19 | } else { 20 | statementN 21 | } 22 | ``` 23 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Generate-Random-Whole-Numbers-with-JavaScript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Generate Random Whole Numbers with JavaScript 9 | It's great that we can create random decimal numbers, but it's even more useful if we lot more useful to generate a random whole number. 10 | 11 | To achieve this we can multiply the random number by ten and use the `Math.floor()` to convert the decimal number to a whole number 12 | 13 | `Math.floor(Math.random()*10)` 14 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Introducing-Else-If-Statements.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Introducing Else If Statements 9 | If you have multiple conditions that need to be addressed, you can chain `if` statements together with `else if` statements. 10 | 11 | ## Example 12 | 13 | ```js 14 | if (num > 15) { 15 | return "Bigger than 15"; 16 | } else if (num < 5) { 17 | return "Smaller than 5"; 18 | } else { 19 | return "Between 5 and 15"; 20 | } 21 | ``` 22 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Condense-arrays-with-reduce.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Condense arrays with reduce 9 | Reduce can be useful for condensing an array or numbers into one value. 10 | 11 | ```js 12 | var array = [4,5,6,7,8]; 13 | var singleVal = 0; 14 | // Only change code below this line. 15 | 16 | var singleVal = array.reduce(function(previousVal, currentVal){ 17 | 18 |   return previousVal+currentVal; 19 | 20 | }); 21 | ``` 22 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Create-Decimal-Numbers-with-JavaScript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Create Decimal Numbers with JavaScript 9 | We can store `decimal` numbers in variables too. Decimal numbers are sometimes referred to as `floating point` numbers or `floats`. 10 | 11 | **Note** 12 | 13 | Not all real numbers can accurately be represented in floating point. This can lead to rounding errors. Details Here. 14 | 15 | ## Example 16 | `var myDecimal = 2.82; 17 | ` 18 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Write-Reusable-JavaScript-with-Functions.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Write Reusable JavaScript with Functions 9 | In JavaScript, we can divide up our code into reusable parts called functions. 10 | 11 | Here's an example of a function: 12 | 13 | ```js 14 | function functionName (a, b) { 15 |   return(a + b); 16 | } 17 | ``` 18 | 19 | We can "call" our function like this: `functionName();`, and it will run and return it's return value to us. 20 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Iterate-over-Arrays-with-map.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Iterate over Arrays with map 9 | Using _map_ is the best way to iterate through an array or object. Map uses a function to pretty much do whatever you want it to do. It will pass each value to the callback function. 10 | 11 | ```js 12 | //Use map to add three to each value in the array 13 | var array = [1,2,3,4,5]; 14 | 15 | array = array.map(function(val){ 16 | return val + 3; 17 | }); 18 | ``` 19 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Constructing-Strings-with-Variables.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Constructing Strings with Variables 9 | Sometimes you will need to build a string, [Mad Libs](https://en.wikipedia.org/wiki/Mad_Libs) style. By using the concatenation operator `+`, you can insert one or more variables into a string you're building. 10 | 11 | ## Example 12 | 13 | ```js 14 | var ourName = "Free Code Camp"; 15 | var ourStr = "Hello, our name is " + ourName + ", how are you?"; 16 | ``` 17 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Store-Multiple-Values-in-one-Variable-using-JavaScript-Arrays.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Store Multiple Values in one Variable using JavaScript Arrays 9 | With JavaScript array variables, we can store several pieces of data in one place. 10 | 11 | You start an array declaration with an opening bracket, end it with a closing bracket, and put a comma between each entry, like this: `var sandwich = ["peanut butter", "jelly", "bread"]`. 12 | 13 | `myArray = [2,'j'];` 14 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Understand-Boolean-Values.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Understand Boolean Values 9 | `Data` is anything that is meaningful to the computer. 10 | 11 | In computer science, _Data types_ are things that represent various types of data. JavaScript has seven data types which are `Undefined`, `Null`, `Boolean`, `String`, `Symbol`, `Number`, and `Object`. 12 | 13 | Booleans can only hold the value of either `true` or `false`. They are basically little on-off switches. 14 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Use-Bracket-Notation-to-Find-the-Last-Character-in-a-String.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Use Bracket Notation to Find the Last Character in a String 9 | In order to get the last letter of a string, you can subtract one from the string's length. 10 | 11 | For example, if `var firstName = "Charles"`, you can get the value of the last letter of the string by using `firstName[firstName.length - 1]`. 12 | 13 | `var lastLetterOfLastName = lastName[lastName.length -1];` 14 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Customize-Angularjs-Directives.md: -------------------------------------------------------------------------------- 1 | # How to build Custom Directives 2 | To declutter your code you can create a new html file with the angular code and use `ng-include` to add it to the main html. The `nh-include` expects a variable with the name of the file to include, to pass the name directly you can use a string with single quotes inside the double quotes. 3 | 4 | ```html 5 |

6 | ``` 7 | 8 | **Directives** allow you to write HTML that expresses the behavior of your application. **Template-expanding Directives** are the simples, they define a custom tag or attribute that is expanded or replaced, and can include **Controller** logic if needed. 9 | 10 | Directives can also be used for: 11 | - Expressing complex UI 12 | - Calling events and registering event handles 13 | - Reusing common components 14 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Introducing-Else-Statements.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Introducing Else Statements 9 | When a condition for an `if` statement is true, the block of code following it is executed. What about when that condition is false? Normally nothing would happen. With an `else` statement, an alternate block of code can be executed. 10 | 11 | ## Example 12 | 13 | ```js 14 | if (num > 10) { 15 | return "Bigger than 10"; 16 | } else { 17 | return "10 or Less"; 18 | } 19 | ``` 20 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Storing-Values-with-the-Equal-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Storing Values with the Equal Operator 9 | In Javascript, you can store a value in a variable with the assignment or equal (=) operator. 10 | 11 | `myVariable = 5;` 12 | 13 | Assignment always goes from right to left. Everything to the right of the = operator is resolved before the value is assigned to the variable to the left of the operator. 14 | 15 | ```js 16 | myVar = 5; 17 | 18 | myNum = myVar; 19 | ``` 20 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Return-A-Value-From-A-Function-With-Return.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Return a Value from a Function with Return 9 | We can pass values into a function with `arguments`. You can use a `return` statement to send a value back out of a function. 10 | 11 | ## Example 12 | 13 | ```js 14 | function plusThree(num) { 15 | return num + 3; 16 | } 17 | var answer = plusThree(5); // 8 18 | ``` 19 | 20 | `plusThree` takes an `argument` for `num` and returns a value equal to `num + 3`. 21 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Comparison-With-The-Strict-Equality-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Comparison with the Strict Equality Operator 9 | Strict equality (`===`) is the counterpart to the equality operator (`==`). Unlike the equality operator, strict equality tests both the `type` and `value` of the compared elements. 10 | 11 | ## Example 12 | 13 | ```js 14 | 3 === 3 // true 15 | 3 === '3' // false 16 | ``` 17 | 18 | _In the second example, `3` is a `Number` type and `'3'` is a `String` type._ 19 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Comparison-With-The-Strict-Inequality-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Comparison with the Strict Inequality Operator 9 | The strict inequality operator `!==` is the opposite of the strict equality operator. It means "Strictly Not Equal" and returns `false` where strict equality would return `true` and vice versa. Strict inequality will not convert data types. 10 | 11 | ## Examples 12 | 13 | ```js 14 | 3 !== 3 // false 15 | 3 !== '3' // true 16 | 4 !== 3 // true 17 | ``` 18 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Iterate-Odd-Numbers-With-a-For-Loop.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Iterate Odd Numbers With a For Loop 9 | For loops don't have to iterate one at a time. By changing our `final-expression`, we can count by even numbers. 10 | 11 | We'll start at `i = 0` and loop while `i < 10`. We'll increment `i` by 2 each loop with `i += 2`. 12 | 13 | ```js 14 | var ourArray = []; 15 | 16 | for(var i = 0; i < 10; i += 2) { 17 | 18 | ourArray.push(i); 19 | 20 | } 21 | ``` 22 | 23 | ourArray will now contain `[0,2,4,6,8]` 24 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Concatenating-Strings-with-Plus-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Concatenating Strings with Plus Operator 9 | In JavaScript, when the `+` operator is used with a String value, it is called the `concatenation` operator. You can build a new string out of other strings by concatenating them together. 10 | 11 | ## Example 12 | `'My name is Alan,' + ' I concatenate.'` 13 | 14 | ## Note 15 | Watch out for spaces. Concatenation does not add spaces between concatenated strings, so you'll need to add them yourself. 16 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Understanding-Uninitialized-Variables.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Understanding Uninitialized Variables 9 | When JavaScript variables are declared, they have an initial value of `undefined`. If you do a mathematical operation on an undefined variable your result will be `NaN` which means "Not a Number". If you concatenate a string with an undefined variable, you will get a literal string of "undefined". 10 | 11 | Basically this means that before you do any operations with them you **must** assign an initial value at some point. 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Global-Vs-Local-Scope-In-Functions.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Global vs Local Scope in Functions 9 | It is possible to have both `local` and `global` variables with the same name. When you do this, the local variable takes precedence over the `global` variable. 10 | 11 | ## Example 12 | 13 | ```js 14 | var someVar = "Hat"; 15 | function myFun() { 16 | var someVar = "Head"; 17 | return someVar; 18 | } 19 | ``` 20 | 21 | The function `myFun` will return `"Head"` because the `local` version of the variable is present. 22 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/JSON-Ajax/Lesson-Prefilter-JSON.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Prefilter JSON 9 | The **filter()** method creates a new array with all elements that pass the test implemented by the provided function. 10 | 11 | So when you don't want to work with all the elements from the array then you can use filter. 12 | 13 | Let's filter out the cat who's "id" key has a value of 1. 14 | 15 | Here's the code to do this: 16 | 17 | ```js 18 | 19 | json = json.filter(function(val) { 20 | 21 | return(val.id !== 1); 22 | 23 | }); 24 | ``` 25 | 26 | More about filter: 27 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Assignment-with-Plus-Equals.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Assignment with Plus Equals 9 | Everything to the right of the equals sign is evaluated first, so we can say `myVar = myVar + 5;` to add `5` to `myVar`. Since this is such a common pattern, there are operators which do both a mathematical operation and assignment in one step. 10 | 11 | One such operator is the `+= operator`. 12 | 13 | `myVar += 5;` will add 5 to myVar instead of using any of the follwoing: 14 | 15 | ```js 16 | myVar = 5 + myVar; 17 | myVar = myvar + 5; 18 | ``` 19 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Comparison-With-The-Less-Than-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Comparison with the Less Than Operator 9 | The less than operator (`<`) compares the values of two numbers. If the number to the left is less than the number to the right, it returns `true`. Otherwise, it returns `false`. Like the equality operator, less than operator converts data types while comparing. 10 | 11 | ## Examples 12 | 13 | ```js 14 | 2 < 5 // true 15 | '3' < 7 // true 16 | 5 < 5 // false 17 | 3 < 2 // false 18 | '8' < 4 // false 19 | ``` 20 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Build-JavaScript-Objects.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Build JavaScript Objects 9 | Objects are similar to arrays, except that instead of using indexes to access and modify their data, you access the data in objects through what are called properties. 10 | 11 | Here's a sample object: 12 | 13 | ```js 14 | var cat = { 15 | "name": "Whiskers", 16 | "legs": 4, 17 | "tails": 1, 18 | "enemies": ["Water", "Dogs"] 19 | }; 20 | ``` 21 | 22 | Objects are useful for storing data in a structured way, and can represents real world objects, like a cats. 23 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Comparison-With-The-Greater-Than-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Comparison with the Greater Than Operator 9 | The greater than operator `>` compares the values of two numbers. If the number to the left is greater than the number to the right, it returns `true`. Otherwise, it returns `false`. 10 | 11 | Like the equality operator, greater than operator will convert data types of values while comparing. 12 | 13 | ## Examples 14 | 15 | ```js 16 | 5 > 3 // true 17 | 7 > '3' // true 18 | 2 > 3 // false 19 | '1' > 9 // false 20 | ``` 21 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Global-Scope-And-Functions.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Global Scope and Functions 9 | In JavaScript, `scope` refers to the visibility of variables. Variables which are defined outside of a function block have `Global` scope. This means, they can be seen everywhere in your JavaScript code. 10 | 11 | Variables which are used without the `var` keyword are automatically created in the `global` scope. This can create unintended consequences elsewhere in your code or when running a function again. You should always declare your variables with `var`. 12 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Comparison-With-The-Inequality-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Comparison with the Inequality Operator 9 | The inequality operator (`!=`) is the opposite of the equality operator. It means "Not Equal" and returns `false` where equality would return `true` and vice versa. Like the equality operator, the inequality operator will convert data types of values while comparing. 10 | 11 | ## Examples 12 | 13 | ```js 14 | 1 != 2 // true 15 | 1 != "1" // false 16 | 1 != '1' // false 17 | 1 != true // false 18 | 0 != false // false 19 | ``` 20 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Concatenating-Strings-with-the-Plus-Equals-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Concatenating Strings with the Plus Equals Operator 9 | We can use the `+=` operator to concatenate a string onto the end of an existing string variable. This can be very helpful to break a long string over several lines. 10 | 11 | ## Note 12 | Watch out for spaces. Concatenation does not add spaces between concatenated strings, so you'll need to add them yourself. 13 | 14 | ## Example 15 | 16 | ```js 17 | var ourStr = "I come first. "; 18 | ourStr += "I come second."; 19 | ``` 20 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Local-Scope-And-Functions.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Local Scope and Functions 9 | Variables which are declared within a function, as well as the function parameters have local scope. That means, they are only visible within that function. 10 | 11 | ## Example 12 | Here is a function `myTest` with a local variable called `loc`. 13 | 14 | ```js 15 | function myTest() { 16 | var loc = "foo"; 17 | console.log(loc); 18 | } 19 | myTest(); // "foo" 20 | console.log(loc); // "undefined" 21 | ``` 22 | 23 | `loc` is not defined outside of the function. 24 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Return-Early-Pattern-For-Functions.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Return Early Pattern for Functions 9 | When a `return` statement is reached, the execution of the current function stops and control returns to the calling location. 10 | 11 | ## Example 12 | 13 | ```js 14 | function myFun() { 15 | console.log("Hello"); 16 | return "World"; 17 | console.log("byebye") 18 | } 19 | myFun(); 20 | ``` 21 | 22 | The above outputs "Hello" to the console, returns "World", but `"byebye"` is never output, because the function exits at the `return` statement. 23 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Escape-Sequences-in-Strings.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Escape Sequences in Strings 9 | Quotes are not the only characters that can be escaped inside a string. Here is a table of common escape sequences: 10 | 11 | **Code** | **Output** 12 | -------- | --------------- 13 | \' | single quote 14 | \" | double quote 15 | \\ | backslash 16 | \n | new line 17 | \r | carriage return 18 | \t | tab 19 | \b | backspace 20 | \f | form feed 21 | 22 | _Note that the backslash itself must be escaped in order to display as a backslash._ 23 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Escaping-Literal-Quotes-in-Strings.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Escaping Literal Quotes in Strings 9 | In JavaScript, you can escape a quote from considering it as an end of string quote by placing a backslash `\` in front of the quote. 10 | 11 | `"Alan said, \"Peter is learning JavaScript\"."` 12 | 13 | This signals JavaScript that the following quote is not the end of the string, but should instead appear inside the string. 14 | 15 | However another option is to alternate quotation marks if possible. `'Alan said, "Peter is learning JavaScript"'` this would also work. 16 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Testing-Objects-For-Properties.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Testing Objects for Properties 9 | Sometimes it is useful to check if the property of a given object exists or not. We can use the `.hasOwnProperty([propname])` method of objects to determine if that object has the given property name. `.hasOwnProperty()` returns _true_ or _false_ if the property is found or not. 10 | 11 | ## Example 12 | 13 | ```js 14 | var myObj = { 15 | top: "hat", 16 | bottom: "pants" 17 | }; 18 | myObj.hasOwnProperty("top"); // true 19 | myObj.hasOwnProperty("middle"); 20 | ``` 21 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/Express/Build-Web-Apps-With-Express.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # Build Web Apps with Express.js 10 | 11 | Here you will have easy access to all the related articles. 12 | 13 | - [Hello World!](Express-App-Hello-World) 14 | - [Static](Express-App-Static) 15 | - [Jade](Express-App-Jade) 16 | - [Good Old Form](Express-App-Good-Old-Form) 17 | - [Stylish CSS](Express-App-Stylish-CSS) 18 | - [Param Pam Pam](Express-App-Param-Pam-Pam) 19 | - [What's In Query](Express-App-Whats-In-Query) 20 | - [JSON Me](Express-App-JSON-Me) 21 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/Automated-Testing-And-Debugging/Lesson-Use-the-Javascript-Console.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Use the Javascript Console 9 | Both Chrome and Firefox have excellent JavaScript consoles, also known as DevTools, for debugging your JavaScript. 10 | 11 | You can find Developer tools in your Chrome's menu or Web Console in FireFox's menu. If you're using a different browser, or a mobile phone, we strongly recommend switching to desktop Firefox or Chrome. 12 | 13 | You can also use [https://repl.it/](https://repl.it/) to run code online. 14 | 15 | This is how you print to the console: `console.log('Hello world!')` 16 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Comparison-With-The-Greater-Than-Equal-To-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Comparison with the Greater Than Equal To Operator 9 | The greater than equal to operator `>=` compares the values of two numbers. If the number to the left is greater than or equal to the number to the right, it returns `true`. Otherwise, it returns `false`. 10 | 11 | Like the equality operator, greater than equal to operator will convert data types while comparing. 12 | 13 | ## Examples 14 | 15 | ```js 16 | 6 >= 6 // true 17 | 7 >= '3' // true 18 | 2 >= 3 // false 19 | '7' >= 9 // false 20 | ``` 21 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Assignment-With-A-Returned-Value.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Assignment with a Returned Value 9 | If you'll recall from our discussion of Storing Values with the Equal Operator, everything to the right of the equal sign is resolved before the value is assigned. This means we can take the return value of a function and assign it to a variable. 10 | 11 | Assume we have pre-defined a function `sum` which adds two numbers together, then: 12 | 13 | ```js 14 | var ourSum = sum(5, 12); 15 | ``` 16 | 17 | will call `sum` function, which returns a value of `17` and assigns it to `ourSum` variable. 18 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Comment-your-JavaScript-Code.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Comment your JavaScript Code 9 | Comments are a great way to leave notes to yourself and to other people who will later need to figure out what it does. Any code in it will be ignored. 10 | 11 | Let's take a look at the two ways you can write comments in JavaScript. 12 | - The double-slash comment will comment out the remainder of the text on the current line: 13 | 14 | `// This is a comment.` 15 | - The slash-star-star-slash comment will comment out everything between the `/*` and the `*/` characters: 16 | 17 | `/* This is also a comment */` 18 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Count-Backwards-With-a-For-Loop.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Count Backwards With a For Loop 9 | A for loop can also count backwards, so long as we can define the right conditions. 10 | 11 | In order to count backwards by twos, we'll need to change our `initialization`, `condition`, and `final-expression`. 12 | 13 | We'll start at `i = 10` and loop while `i > 0`. We'll decrement `i` by `2` each loop with `i -= 2`. 14 | 15 | ```js 16 | var ourArray = []; 17 | 18 | for(var i = 10; i > 0; i -= 2) { 19 | 20 | ourArray.push(i); 21 | 22 | } 23 | ``` 24 | 25 | ourArray will now contain `[10,8,6,4,2]` 26 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Construct-JavaScript-Objects-with-Functions.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Construct JavaScript Objects with Functions 9 | Another way to create objects is with constructors. I particularly like them because them you can create more objects using them as a base. 10 | 11 | ```js 12 | // Let's add the properties engines and seats to the car in the same way that the property wheels has been added below. They should both be numbers. 13 | var Car = function() { 14 | this.wheels = 4; 15 | this.engines = 1; 16 | this.seats = 1; 17 | }; 18 | 19 | var myCar = new Car(); 20 | ``` 21 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/MongoDB/Store-Data-In-MongoDB.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # Store Data in MongoDB 10 | 11 | Whenever you run a command that includes **mongod** on c9.io, be sure to also use the `--nojournal` flag, like this: `mongod --nojournal`. 12 | 13 | ## More 14 | 15 | - [Mongod](MongoDB-Mongod) 16 | - [Connect](MongoDB-Connect) 17 | - [Find](MongoDB-Find) 18 | - [Find Project](MongoDB-Find-Project) 19 | - [Insert](MongoDB-Insert) 20 | - [Update](MongoDB-Update) 21 | - [Remove](MongoDB-Remove) 22 | - [Count](MongoDB-Count) 23 | - [Aggregate](MongoDB-Aggregate) 24 | - [Rounding](MongoDB-Rounding) 25 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Use-Bracket-Notation-to-Find-the-First-Character-in-a-String.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Use Bracket Notation to Find the First Character in a String 9 | _Bracket notation_ is a way to get a character at a specific index within a string. 10 | 11 | Most modern programming languages, like JavaScript, don't start counting at `1` like humans do. They start at `0`. This is refered to as `Zero-based indexing`. 12 | 13 | ## Example 14 | 15 | The character at `index 0` in the word `Charles` is `C`. So if `var firstName = "Charles"`, you can get the value of the first letter of the string by using `firstName[0]`. 16 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/MongoDB/MongoDB-Mongod.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # Mongod 10 | 11 | Hey hey from learnyoumongo. First, let's get MongoDB installed. You can download MongoDB from . 12 | 13 | We will also need to add it to your `$PATH`. 14 | 15 | ## HINTS 16 | 17 | To verify that mongod is installed, you can try running `mongod --version`. 18 | 19 | If you are on Windows, you will need to use` mongod.exe` instead. 20 | 21 | It should print out something similar to: 22 | 23 | ```bash 24 | db version v2.6.8 25 | 2015-05-06T09:44:39.362-0500 git version: nogitversion 26 | ``` 27 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Accessing-Objects-Properties-With-The-Dot-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Accessing Objects Properties with the Dot Operator 9 | There are two ways to access the properties of an object: the dot operator `.` and bracket notation `[]`, similar to an array. 10 | 11 | The dot operator is what you use when you know the name of the property you're trying to access ahead of time. 12 | 13 | Here is a sample of using the dot operator `.` to read an object property: 14 | 15 | ```js 16 | var myObj = { 17 | prop1: "val1", 18 | prop2: "val2" 19 | }; 20 | myObj.prop1; // val1 21 | myObj.prop2; // val2 22 | ``` 23 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Comparison-With-The-Less-Than-Equal-To-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Comparison with the Less Than Equal To Operator 9 | The less than equal to operator `<=` compares the values of two numbers. If the number to the left is less than or equal the number to the right, it returns `true`. If the number on the left is greater than the number on the right, it returns `false`. Like the equality operator, `less than equal to` converts data types. 10 | 11 | ## Examples 12 | 13 | ```js 14 | 4 <= 5 // true 15 | '7' <= 7 // true 16 | 5 <= 5 // true 17 | 3 <= 2 // false 18 | '8' <= 4 // false 19 | ``` 20 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Declare-JavaScript-Objects-as-Variables.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Construct JavaScript Objects with Functions 9 | Using constructors it is easy to create new objects using a blueprint or constructor. The declaration syntax is a little different but still easy to remember. 10 | 11 | ```js 12 | // Let's add the properties engines and seats to the car in the same way that the property wheels has been added below. They should both be numbers. 13 | var Car = function() { 14 | this.wheels = 4; 15 | this.engines = 1; 16 | this.seats = 1; 17 | }; 18 | 19 | var myCar = new Car(); 20 | ``` 21 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Access-Multi-Dimensional-Arrays-With-Indexes.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Access Multi-Dimensional Arrays With Indexes 9 | One way to think of a `multi-dimensional` array, is as an array of arrays. When you use brackets to access your array, the first set of bracket refers to the entries in the outer-most array, and each subsequent level of brackets refers to the next level of entries inside. 10 | 11 | ## Example 12 | 13 | ```js 14 | var arr = [ 15 | [1,2,3], 16 | [4,5,6], 17 | [7,8,9], 18 | [[10,11,12], 13, 14] 19 | ]; 20 | arr[0]; // equals [1,2,3] 21 | arr[1][2]; // equals 6 22 | arr[3][0][1]; // equals 11 23 | ``` 24 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Accessing-Nested-Objects-In-JSON.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Accessing Nested Objects in JSON 9 | The properties and sub-properties of JSON objects can be accessed by chaining together the `dot` or `bracket` notation. 10 | 11 | Here is a nested JSON Object: 12 | 13 | ```js 14 | var ourStorage = { 15 | "desk": { 16 | "drawer": "stapler" 17 | }, 18 | "cabinet": { 19 | "top drawer": { 20 | "folder1": "a file", 21 | "folder2": "secrets" 22 | }, 23 | "bottom drawer": "soda" 24 | } 25 | } 26 | ourStorage.cabinet["top drawer"].folder2; // "secrets" 27 | ourStorage.desk.drawer; // "stap 28 | ``` 29 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/JSON-Ajax/Lesson-Trigger-Click Events-with-jQuery.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Trigger Click Events with jQuery 9 | APIs - or Application Programming Interfaces - are tools that computers use to communicate with one another. 10 | 11 | `$(document).ready()` This function makes it so all code inside of it only runs once our page loads. 12 | 13 | Inside that you can add any function or code, for this particular lesson you need to add a click handler: 14 | 15 | ```js 16 | $("#getMessage").on("click", function(){ 17 | 18 | }); 19 | ``` 20 | 21 | This will create a function so when the element with id `getMessage` is clicked, the custom function will be run. 22 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Finding-a-Remainder-in-Javascript.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Finding a Remainder in Javascript 9 | The _remainder operator_ `%` gives the remainder of the division of two numbers. 10 | 11 | ## Example 12 | 13 | ``` 14 | 5 % 2 = 1 because 15 | Math.floor(5 / 2) = 2 (Quotient) 16 | 2 * 2 = 4 17 | 5 - 4 = 1 (Remainder) 18 | ``` 19 | 20 | ## Usage 21 | In mathematics, a number can be checked even or odd by checking the remainder of the division of the number by 2. 22 | 23 | ``` 24 | 17 % 2 = 1 (17 is Odd) 25 | 48 % 2 = 0 (48 is Even) 26 | ``` 27 | 28 | **Note** Do not confuse it with _modulus_ `%` does not work well with negative numbers. 29 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Replacing-If-Else-Chains-With-Switch.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Replacing If Else Chains with Switch 9 | If you have many options to choose from, a `switch` statement can be easier to write than many chained `if/if` else statements. The following: 10 | 11 | ```js 12 | if(val === 1) { 13 | answer = "a"; 14 | } else if(val === 2) { 15 | answer = "b"; 16 | } else { 17 | answer = "c"; 18 | } 19 | ``` 20 | 21 | can be replaced with: 22 | 23 | ```js 24 | switch (val) { 25 | case 1: 26 | answer = "a"; 27 | break; 28 | case 2: 29 | answer = "b"; 30 | break; 31 | default: 32 | answer = "c"; 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Using-Objects-For-Lookups.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Using Objects for Lookups 9 | Objects can be thought of as a `key/value storage`, like a dictionary. If you have tabular data, you can use an object to "lookup" values rather than a `switch` statement or an `if/else` chain. This is most useful when you know that your input data is limited to a certain range. 10 | 11 | Here is an example of a simple reverse alphabet lookup: 12 | 13 | ```js 14 | var alpha = { 15 | 1:"Z", 16 | 2:"Y", 17 | 3:"X", 18 | 4:"W", 19 | ... 20 | 24:"C", 21 | 25:"B", 22 | 26:"A" 23 | }; 24 | alpha[2]; // "Y" 25 | alpha[24]; // "C" 26 | ``` 27 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Multiple-Identical-Options-In-Switch-Statements.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Multiple Identical Options in Switch Statements 9 | If the `break` statement is ommitted from a `switch` statement's `case`, the following `case` statement(s) are executed until a `break` is encountered. If you have multiple inputs with the same output, you can represent them in a `switch` statement like this: 10 | 11 | ```js 12 | switch(val) { 13 | case 1: 14 | case 2: 15 | case 3: 16 | result = "1, 2, or 3"; 17 | break; 18 | case 4: 19 | result = "4 alone"; 20 | } 21 | ``` 22 | 23 | Cases for 1, 2, and 3 will all produce the same result. 24 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Accessing-Nested-Arrays-In-JSON.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Accessing Nested Arrays in JSON 9 | As we have seen in earlier examples, `JSON objects` can contain both _nested objects_ and _nested arrays_. Similar to accessing nested objects, `Array bracket 10 | ` notation can be chained to access nested arrays. 11 | 12 | Here is an example of how to access a nested array: 13 | 14 | ```js 15 | var ourPets = { 16 | "cats": [ 17 | "Meowzer", 18 | "Fluffy", 19 | "Kit-Cat" 20 | ], 21 | "dogs": [ 22 | "Spot", 23 | "Bowser", 24 | "Frankie" 25 | ] 26 | }; 27 | ourPets.cats[1]; // "Fluffy" 28 | ourPets.dogs[0]; // "Spot" 29 | ``` 30 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Comparisons-With-The-Logical-Or-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Comparisons with the Logical Or Operator 9 | The `logical or` operator `||` returns `true` if either of the `operands` is `true`. Otherwise, it returns `false`. 10 | 11 | The pattern below should look familiar from prior Lessons: 12 | 13 | ```js 14 | if (num > 10) { 15 | return "No"; 16 | } 17 | if (num < 5) { 18 | return "No"; 19 | } 20 | return "Yes"; 21 | ``` 22 | 23 | will return "Yes" only if `num` is between `5` and `10` (5 and 10 included). The same logic can be written as: 24 | 25 | ```js 26 | if (num > 10 || num < 5) { 27 | return "No"; 28 | } 29 | return "Yes"; 30 | ``` 31 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Iterate-Through-An-Array-With-A-For-Loop.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Iterate Through an Array with a For Loop 9 | A common task in Javascript is to iterate through the contents of an array. One way to do that is with a `for` loop. This code will output each element of the array `arr` to the console: 10 | 11 | ```js 12 | var arr = [10,9,8,7,6]; 13 | for (var i=0; i < arr.length; i++) { 14 | console.log(arr[i]); 15 | } 16 | ``` 17 | 18 | Remember that Arrays have zero-based numbering, which means the last index of the array is `length - 1 19 | `. Our `condition` for this loop is `i < arr.length`, which stops when `i` is at `length - 1`. 20 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Adding-A-Default-Option-In-Switch-Statements.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Adding a default option in Switch statements 9 | In a `switch` statement you may not be able to specify all possible values as `case` statements. Instead, you can add the `default` statement which will be executed if no matching `case` statements are found. Think of it like the final `else` statement in an `if/else` chain. 10 | 11 | A `default` statement should be the last case. 12 | 13 | ```js 14 | switch (num) { 15 | case value1: 16 | statement1 17 | break; 18 | case value2: 19 | statement2; 20 | break; 21 | ... 22 | default: 23 | defaultStatement; 24 | } 25 | ``` 26 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Quoting-Strings-with-Single-Quotes.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Quoting Strings with Single Quotes 9 | String values in JavaScript may be written with single or double quotes, so long as you start and end with the same type of quote. Unlike some languages, single and double quotes are functionally identical in Javascript. 10 | 11 | `"This string has \"double quotes\" in it"` 12 | 13 | The value in using one or the other has to do with the need to escape quotes of the same type. If you have a string with many double quotes, this can be difficult to read and write. Instead, use single quotes: 14 | 15 | `'This string has "double quotes" in it. And "probably" lots of them.'` 16 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Accessing-Objects-Properties-With-Bracket-Notation.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Accessing Objects Properties with Bracket Notation 9 | The second way to access the properties of an object is bracket notation `[]`. If the property of the object you are trying to access has a space in it, you will need to use bracket notation. 10 | 11 | Here is a sample of using bracket notation to read an object property: 12 | 13 | ```js 14 | var myObj = { 15 | "Space Name": "Kirk", 16 | "More Space": "Spock" 17 | }; 18 | myObj["Space Name"]; // Kirk 19 | myObj['More Space']; // Spock 20 | ``` 21 | 22 | **Note** that property names with spaces in them must be in quotes (single or double). 23 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Nesting-For-Loops.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Nesting For Loops 9 | If you have a multi-dimensional array, you can use the same logic as the prior lesson `Iterate Through an Array with a For Loop` to loop through both the array and any sub-arrays. Here is an example: 10 | 11 | ```js 12 | var arr = [ 13 | [1,2], [3,4], [5,6] 14 | ]; 15 | for (var i=0; i < arr.length; i++) { 16 | for (var j=0; j < arr[i].length; j++) { 17 | console.log(arr[i][j]); 18 | } 19 | } 20 | ``` 21 | 22 | This outputs each sub-element in `arr` one at a time. Note that for the inner loop, we are checking the `.length` of `arr[i]`, since `arr[i]` is itself an array. 23 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Accessing-Objects-Properties-With-Variables.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Accessing Objects Properties with Variables 9 | Another use of bracket notation on objects is to use a variable to access a property. This can be very useful for iterating through lists of the object properties or for doing the lookup. 10 | 11 | Here is an example of using a variable to access a property: 12 | 13 | ```js 14 | var someProp = "propName"; 15 | var myObj = { 16 | propName: "Some Value" 17 | } 18 | ``` 19 | 20 | `myObj[someProp]; // "Some Value"` **Note** that we do not use quotes around the variable name when using it to access the property because we are using the value of the variable, not the name 21 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Returning-Boolean-Values-From-Functions.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Returning Boolean Values from Functions 9 | You may recall from Comparison with the `Equality Operator` that all comparison operators return a boolean `true` or `false` value. 10 | 11 | A common `anti-pattern` is to use an `if/else` statement to do a comparison and then return `true/false`: 12 | 13 | ```js 14 | function isEqual(a,b) { 15 | if(a === b) { 16 | return true; 17 | } else { 18 | return false; 19 | } 20 | } 21 | ``` 22 | 23 | Since `===` returns `true` or `false`, we can simply return the result of the comparison: 24 | 25 | ```js 26 | function isEqual(a,b) { 27 | return a === b; 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/JSON-Ajax/Lesson-Get-JSON-with-the-jQuery-getJSON-Method.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Get JSON with the jQuery getJSON Method 9 | Application Programming Interfaces - are tools that computers use to communicate with one another. 10 | 11 | Most web APIs transfer data in a format called JSON. JSON stands for JavaScript Object Notation. JSON is nothing more than object properties and their current values, sandwiched between a `{` and a `}`. 12 | 13 | These properties and their values are often referred to as "key-value pairs". 14 | 15 | Here is a sample of what it looks like. 16 | 17 | ```js 18 | $.getJSON("/json/cats.json", function(json) { 19 | 20 | $(".message").html(JSON.stringify(json)); 21 | 22 | }); 23 | ``` 24 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Comparisons-With-The-Logical-And-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Comparisons with the Logical And Operator 9 | Sometimes you will need to test more than one thing at a time. The `logical and` operator `&&` returns `true` if and only if the `operands` to the left and right of it are true. 10 | 11 | The same effect could be achieved by nesting an if statement inside another if: 12 | 13 | ```js 14 | if (num > 5) { 15 | if (num < 10) { 16 | return "Yes"; 17 | } 18 | } 19 | return "No"; 20 | ``` 21 | 22 | will only return "Yes" if `num` is between `6` and `9` (6 and 9 included). The same logic can be written as: 23 | 24 | ```js 25 | if (num > 5 && num < 10) { 26 | return "Yes"; 27 | } 28 | return "No"; 29 | ``` 30 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Make-Unique-Objects-by-Passing-Parameters-to-our-Constructor.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Make Unique Objects by Passing Parameters to our Constructor 9 | When you have a constructor but don't want to keep creating the same object, all you have to do is add parameters to the constructor the following way: 10 | 11 | ```js 12 | var Car = function(wheels, seats, engines) { 13 | 14 | this.wheels = wheels; 15 | 16 | this.seats = seats; 17 | 18 | this.engines = engines; 19 | 20 | }; 21 | ``` 22 | 23 | Now you can pass in arguments when you call the constructor. `var myCar = new Car(6, 3, 1);` 24 | 25 | This will result in: 26 | 27 | ```js 28 | { 29 | 30 | wheels: 6, 31 | 32 | seats: 3, 33 | 34 | engines: 1 35 | 36 | } 37 | ``` 38 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Convert-JSON-Data-to-HTML.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Convert JSON Data to HTML 9 | Once you know how to get data from the JSON call then is time to learn how to iterate through it. We can use the .map() method to loop through our data and modify our HTML elements. 10 | 11 | Here is a code that does that: 12 | 13 | ```js 14 | // calling map on the json variable and using a custom callback function. 15 | json.map(function(val) { 16 | 17 | // Adding each object keys 18 | var keys = Object.keys(val); 19 | // Generating new html 20 | html += "
"; 21 | // Adding the custom html to each key 22 | keys.map(function(key) { 23 | 24 | html += "" + key + ": " + val[key] + "
"; 25 | 26 | }); 27 | 28 | html += "

"; 29 | 30 | }); 31 | ``` 32 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Sift-through-Text-with-Regular-Expressions.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Sift through Text with Regular Expressions 9 | `Regular expressions` are used to find certain words or patterns inside of strings. 10 | 11 | Regular expressions are usually surrounded by `/` symbols. 12 | 13 | For example, if we wanted to find the number of times the word the occurred in the string The dog chased the cat, we could use the following regular expression: `/the+/gi` 14 | 15 | Let's break this down a bit: 16 | 17 | the is the pattern we want to match. 18 | - `+` means we want to find one or more occurrences of this pattern. 19 | - `g` means that we want to search the entire string for this pattern. 20 | - `i` means that we want to ignore the case (uppercase or lowercase) when searching for the pattern. 21 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Change-Text-Inside-an-Element-Using-jQuery.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Change Text Inside an Element Using jQuery 9 | Using jQuery, you can change the text between the start and end tags of an element. You can even change HTML markup. 10 | 11 | jQuery has a function called `.html()` that lets you add HTML tags and text within an element. Any content previously within the element will be completely replaced with the content you provide using this function. 12 | 13 | Here's how you would rewrite and italicize the text of our heading: 14 | 15 | `$("h3").html("jQuery Funhouse");` 16 | 17 | jQuery also has a similar function called `.text()` that only alters text without adding tags. So when using `.html()` please remember that you will be editing the whole markup and not just the text. 18 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Make-Instances-of-Objects-with-a-Constructor-Function.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Make Instances of Objects with a Constructor Function 9 | A function that creates objects is called a _constructor_, my favorite way of creating objects when you have to create more than one of the same object. You can also edit the second object to add more properties if needed. This is called creating _instances_ of an object. 10 | 11 | Each new instance of this object inherits all the properties and methods of your original object. 12 | 13 | ```js 14 | var Car = function() { 15 | this.wheels = 4; 16 | }; 17 | 18 | // New instance of Car object. 19 | var myCar = new Car(); 20 | 21 | //Add the property "engines" to myCar, and make it a number. 22 | myCar.engines = 1; 23 | ``` 24 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Updating-Object-Properties.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Updating Object Properties 9 | After you've created a JavaScript object, you can update its properties at any time just like you would update any other variable. You can use either dot or bracket notation to update. 10 | 11 | For example, let's look at `ourDog`: 12 | ```js 13 | var ourDog = { 14 | "name": "Camper", 15 | "legs": 4, 16 | "tails": 1, 17 | "friends": ["everything!"] 18 | }; 19 | ``` 20 | Since he's a particularly happy dog, let's change his name to "Happy Camper". Here's how we update his object's name property: 21 | 22 | `ourDog.name = "Happy Camper";` or 23 | 24 | `ourDog["name"] = "Happy Camper";` 25 | 26 | Now when we evaluate `ourDog.name 27 | `, instead of getting "Camper", we'll get his new name, "Happy Camper". 28 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Understanding-Case-Sensitivity-in-Variables.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Understanding Case Sensitivity in Variables 9 | In JavaScript all variables and function names are case sensitive. This means that capitalization matters. 10 | 11 | `MYVAR` is not the same as `MyVar` nor `myvar`. It is possible to have multiple distinct variables with the same name but different casing. It is strongly recommended that for the sake of clarity, you do not use this language feature. 12 | 13 | ## Best Practice 14 | Write variable names in Javascript in `camelCase`. In `camelCase`, `multi-word` variable names have the first word in lowercase and the first letter of each subsequent word is capitalized. 15 | 16 | ## Examples: 17 | 18 | ```js 19 | var someVariable; 20 | var anotherVariableName; 21 | var thisVariableNameIsTooLong; 22 | ``` 23 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/JSON-Ajax/Lesson-Get-Geo-location-Data.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Get Geo-location Data 9 | Every browser has a built in navigator that can give us this information. 10 | 11 | The navigator will get our user's current longitude and latitude. 12 | 13 | You will see a prompt to allow or block this site from knowing your current location. The challenge can be completed either way, as long as the code is correct. 14 | 15 | By selecting allow you will see the text on the output phone change to your latitude and longitude 16 | 17 | Here's some code that does this: 18 | 19 | ```js 20 | if (navigator.geolocation) { 21 | 22 | navigator.geolocation.getCurrentPosition(function(position) { 23 | 24 | $("#data").html("latitude: " + position.coords.latitude + "
longitude: " + position.coords.longitude); 25 | 26 | }); 27 | 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/MongoDB/MongoDB-Connect.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # MongoDB Connect 10 | 11 | Start **mongod** on port **27017** with _data_ as the **dbpath** 12 | 13 | ## HINTS 14 | 15 | You may have to create the data directory. 16 | 17 | ```bash 18 | mkdir data 19 | ``` 20 | 21 | To start mongo on port 27017, `run mongod --port 27017 --dbpath=./data`. 22 | 23 | Then, in another terminal, run `npm install mongodb`. 24 | 25 | Then, run `learnyoumongo verify`. 26 | 27 | If this lesson is passed, be sure to leave mongod running as it will be used for the remainder of the exercise. 28 | 29 | ## My Solution 30 | 31 | ```bash 32 | rafase282:~/workspace $ mkdir data 33 | rafase282:~/workspace $ mongod --port 27017 --dbpath=./data --nojournal 34 | ``` 35 | 36 | Then open another terminal window and install mongodb using npm. 37 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Selecting-From-Many-Options-With-Switch-Statements.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Selecting from many options with Switch Statements 9 | If you have many options to choose from, use a `switch` statement. A `switch` statement tests a value and can have many `case` statements which defines various possible values. Statements are executed from the first matched `case` value until a `break` is encountered. 10 | 11 | Here is a `pseudocode` example: 12 | 13 | ```js 14 | switch (num) { 15 | case value1: 16 | statement1; 17 | break; 18 | case value2: 19 | statement2; 20 | break; 21 | ... 22 | case valueN: 23 | statementN; 24 | break; 25 | } 26 | ``` 27 | 28 | `case` values are tested with strict equality (`===`). The `break` tells JavaScript to stop executing statements. If the `break` is omitted, the next statement will be executed. 29 | -------------------------------------------------------------------------------- /Templates/Lesson-Template.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 6 | 7 | # Javascript Article Template from Free Code Camp Wiki 8 | 9 | > This Template helps you build JavaScript topic wiki's. 10 | 11 | # Title 12 | 13 | Write a fitting title here 14 | 15 | ## Introduction 16 | 17 | ```javascript 18 | Syntax of the method that you are writing about 19 | ``` 20 | 21 | Parameter | Description | Necessity 22 | --------- | --------------------------------------------- | --------- 23 | Variable | I'm a Description | Required 24 | Object | The position of vertical bar is not important | Optional 25 | 26 | [MDN link](URL here) | [MSDN link](URL here) 27 | 28 | ## Examples 29 | 30 | > You should provide at least 2 different examples 31 | 32 | ```javascript 33 | INSERT EXAMPLE CODE HERE 34 | ``` 35 | 36 | ```javascript 37 | INSERT EXAMPLE CODE HERE 38 | ``` 39 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Introducing-Javascript-Object-Notation-Json.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Introducing JavaScript Object Notation JSON 9 | JavaScript Object Notation or `JSON` uses the format of JavaScript Objects to store data. JSON is flexible because it allows for `Data Structures` with arbitrary combinations of `strings`, `numbers`, `booleans`, `arrays`, and `objects`. 10 | 11 | Here is an example of a JSON object: 12 | 13 | ```js 14 | var ourMusic = [ 15 | { 16 | "artist": "Daft Punk", 17 | "title": "Homework", 18 | "release_year": 1997, 19 | "formats": [ 20 | "CD", 21 | "Cassette", 22 | "LP" ], 23 | "gold": true 24 | } 25 | ]; 26 | ``` 27 | 28 | This is an array of objects and the object has various pieces of `metadata` about an album. It also has a nested `formats` array. Additional album records could be added to the top level array. 29 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Passing-Values-To-Functions-With-Arguments.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Passing Values to Functions with Arguments 9 | `Parameters` are variables that act as placeholders for the values that are to be input to a function when it is called. When a function is defined, it is typically defined along with one or more parameters. The actual values that are input (or "_passed_") into a function when it is called are known as `arguments`. 10 | 11 | Here is a function with two parameters, `param1` and `param2`: 12 | 13 | ```js 14 | function testFun(param1, param2) { 15 | console.log(param1, param2); 16 | } 17 | ``` 18 | 19 | Then we can call testFun: 20 | 21 | `testFun("Hello", "World");` 22 | 23 | We have passed two arguments, `"Hello"` and `"World"`. Inside the function, `param1` will equal "Hello" and `param2` will equal "World". Note that you could call `testFun` again with different arguments and the parameters would take on the value of the new arguments. 24 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Delete-Properties-from-a-JavaScript-Object.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Delete Properties from a JavaScript Object 9 | We can also delete properties from objects like this: 10 | 11 | ```js 12 | delete ourDog.bark; 13 | ``` 14 | 15 | The **delete operator** removes a property from an object. 16 | 17 | ### Syntax 18 | `delete expression` where expression should evaluate to a property reference, e.g.: 19 | 20 | ```js 21 | delete object.property 22 | delete object['property'] 23 | ``` 24 | 25 | ### Parameters 26 | **object** The name of an object, or an expression evaluating to an object. 27 | 28 | **property** The property to delete. 29 | 30 | ### Return value 31 | Throws in [strict](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode) mode if the property is an own non-configurable property (returns false in non-strict). Returns true in all other cases. 32 | 33 | [Read more](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete) 34 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Power-Forms-with-Angularjs.md: -------------------------------------------------------------------------------- 1 | # Forms 2 | 3 | ```html 4 |
  • 5 |
    6 | {{review.stars}} Stars 7 | {{review.body}} 8 | — {{review.author}} 9 |
    10 |
  • 11 | ``` 12 | 13 | # Create A Review Form 14 | 15 | ```html 16 |
    17 | 18 |
    19 | Stars 20 | 21 | 22 |
    23 | 24 | 25 |

    Submit a Review

    26 |
    27 | 30 |
    31 |
    32 | 33 |
    34 |
    35 | 36 |
    37 |
    38 | 39 |
    40 |
    41 | ``` 42 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/Express/Express-App-Hello-World.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # Express App: Hello World! 10 | 11 | Create an Express.js app that outputs "Hello World!" when somebody goes to `/home`. 12 | 13 | The port number will be provided to you by expressworks as the first argument of the application, ie. `process.argv[2]`. 14 | 15 | ## HINTS 16 | 17 | This is how we can create an Express.js app on port 3000, that responds with a string on '/': 18 | 19 | ```javascript 20 | var express = require('express') 21 | var app = express() 22 | app.get('/', function(req, res) { 23 | res.end('Hello World!') 24 | }) 25 | app.listen(3000) 26 | ``` 27 | 28 | Please use process.argv[2] instead of a fixed port number: 29 | 30 | ```javascript 31 | app.listen(process.argv[2]) 32 | ``` 33 | 34 | ## My Solution 35 | 36 | ```javascript 37 | var express = require('express') 38 | var app = express() 39 | app.get('/home', function(req, res) { 40 | res.end('Hello World!') 41 | }) 42 | app.listen(process.argv[2]) 43 | ``` 44 | 45 | It is similar to node which in turn is similar to JavaScript so everything is easier to pickup. 46 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Comparison-With-The-Equality-Operator.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Lesson: Comparison with the Equality Operator 9 | There are many `Comparison Operators` in JavaScript. All of these operators return a boolean `true` or `false` value. 10 | 11 | The most basic operator is the equality operator `==`. The equality operator compares two values and returns `true` if they're equivalent or `false` if they are not. Note that equality is different from assignment (=), which assigns the value at the right of the operator to a variable in the left. 12 | 13 | ## Example 14 | 15 | ```js 16 | function equalityTest(myVal) { 17 | if (myVal == 10) { 18 | return "Equal"; 19 | } 20 | return "Not Equal"; 21 | } 22 | ``` 23 | 24 | If `myVal` is equal to `10`, the function will return "Equal". If it is not, the function will return "Not Equal". 25 | 26 | The equality operator will do its best to convert values for comparison. 27 | 28 | ## Example 29 | 30 | ```js 31 | 1 == 1 // true 32 | "1" == 1 // true 33 | 1 == '1' // true 34 | 0 == false // true 35 | 0 == null // false 36 | 0 == undefined // false 37 | null == undefined // true 38 | ``` 39 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Object-Oriented-And-Functional-Programming/Lesson-Make-Object-Properties-Private.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Make Object Properties Private 9 | Objects have their own attributes, called _properties_, and their own functions, called _methods_. 10 | 11 | You can use the `this` keyword to reference _public properties and methods_ of the current objects. However, when You need to create private ones so they are not accessible from the outside of the object you just remove the keyword `this` from the object property or method declaration and declare it with `var` so that it is private outside its scope. 12 | 13 | ```js 14 | var Bike = function() { 15 | var speed = 100; // private 16 | function addUnit(value) { // private 17 | return value + "KM/H"; 18 | } 19 | 20 | this.getSpeed = function () { // public 21 | return addUnit(speed); 22 | }; 23 | 24 | }; 25 | ``` 26 | 27 | Another example: 28 | 29 | ```js 30 | var Cake = function() { 31 | 32 | var loot = 2; 33 | // Getter to know how much loot you have 34 | this.getLoot = function() { 35 | return loot; 36 | }; 37 | 38 | // Setter to change the ammount of loot 39 | this.setLoot = function(num){ 40 | loot = num; 41 | }; 42 | ``` 43 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/MongoDB/MongoDB-Remove.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # MongoDB Remove 10 | 11 | This lesson involves removing a document with the given `_id`. 12 | 13 | The database name will be accessible via `process.argv[2]`. 14 | 15 | The collection name will be passed as the second argument to your script. 16 | 17 | The `_id` will be passed as the third argument to your script. 18 | 19 | ## HINTS 20 | 21 | To remove a document, one would need to call `remove()` on the collection. 22 | 23 | Ex. 24 | 25 | ```javascript 26 | collection.remove({ 27 | name: 'foo' 28 | }, callback) 29 | ``` 30 | 31 | The first argument to `remove()` is the query. 32 | 33 | If your program does not finish executing, you may have forgotten to close the db. That can be done by calling `db.close()` after you have finished. 34 | 35 | ## Resource 36 | 37 | - 38 | 39 | ## My Solution 40 | 41 | ```javascript 42 | var mongo = require('mongodb').MongoClient; 43 | 44 | var url = 'mongodb://localhost:27017/' + process.argv[2]; 45 | mongo.connect(url, function(err, db) { 46 | if (err) throw err; 47 | var collection = db.collection(process.argv[3]); 48 | collection.remove({ 49 | _id: process.argv[4] 50 | }, function(err) { 51 | if (err) throw err; 52 | db.close(); 53 | }) 54 | }) 55 | ``` 56 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Meet-Bonfire.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 0/5 10 | 11 | Your goal is to fix the failing test. 12 | 13 | First, run all the tests by clicking "Run code" or by pressing Control + Enter. 14 | 15 | The failing test is in red. Fix the code so that all tests pass. Then you can move on to the next Bonfire. 16 | 17 | Make this function return true no matter what. 18 | 19 | ## Useful Links 20 | None 21 | 22 | ## Problem Script: 23 | 24 | ```js 25 | function meetBonfire(argument) { 26 | // Good luck! 27 | console.log("you can read this function's argument in the developer tools", argument); 28 | 29 | return false; 30 | } 31 | 32 | meetBonfire("You can do this!"); 33 | ``` 34 | 35 | ## Explanation: 36 | This is very simple, they just want you to get familiar with how their Bonfires work. 37 | 38 | ## Hint: 1 39 | Read details. 40 | 41 | ## Hint: 2 42 | Did you read all the details? 43 | 44 | ## Hint: 3 45 | You need to change the return statement to what they ask. 46 | 47 | ## My code: 48 | 49 | ```js 50 | function meetBonfire(argument) { 51 | // Good luck! 52 | console.log("you can read this function's argument in the developer tools", argument); 53 | 54 | return true; 55 | } 56 | 57 | meetBonfire("You can do this!"); 58 | ``` 59 | 60 | ## My Code Explanation: 61 | All you had to do was change from false to true. 62 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Review-Template.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | 10 | Details go here 11 | 12 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 13 | 14 | ## Useful Links 15 | - []() 16 | - []() 17 | - []() 18 | 19 | ## Problem Explanation: 20 | - Explain what is asked in an easy to understand way. 21 | 22 | ## Hint: 1 23 | - Add hint here. 24 | 25 | ## Hint: 2 26 | - Add hint here. 27 | 28 | ## Hint: 3 29 | - Add hint here. 30 | 31 | ## Spoiler Alert! 32 | [![687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif](https://files.gitter.im/FreeCodeCamp/Wiki/nlOm/thumb/687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif)](https://files.gitter.im/FreeCodeCamp/Wiki/nlOm/687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif) 33 | 34 | **Solution ahead!** 35 | 36 | ## Code Solution: 37 | 38 | ```js 39 | code here 40 | ``` 41 | 42 | # Code Explanation: 43 | - Explain your code here 44 | 45 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 46 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Fron-End-Projects/Lesson-Get-Set-for-Ziplines.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Get Set for Ziplines 9 | This lesson is all about how to get started. [CodePen](http://codepen.io/) will be used for the ziplines and basically all the front-end dev at FCC. 10 | 11 | ## Instructions 12 | 1. Create your account. 13 | 2. Click your user image in the top right corner, then click the "New pen" button that drops down. 14 | 3. Drag the windows around and press the buttons in the lower-right hand corner to change the orientation to suit your preference. 15 | 4. Click the gear next to CSS. Then under the "Add External CSS" section, use the "Quick-add" select box to select Bootstrap. Then click "Save & Close". 16 | 5. Verify that bootstrap is active by adding the following code to your HTML:

    Hello CodePen!

    . The text's color should be Bootstrap blue. 17 | 6. Click the gear next to JavaScript. Click the "Quick-add" select box and choose jQuery (not jQuery UI). Then click "Save & Close". 18 | 7. Now add the following code to your JavaScript: $(document).ready(function() { $('.text-primary').text('Hi CodePen!') });. Click the "Save" button at the top. Your "Hello CodePen!" should change to "Hi CodePen!". This means that jQuery is working. 19 | 20 | You can use this CodePen that you've just created as a starting point for your Ziplines. Just click the "fork" button at the top of your CodePen and it will create a duplicate CodePen. 21 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/Express/Express-App-Whats-In-Query.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # Express App: What's In Query 10 | 11 | Oftentimes, we need to process the data from the URL query string (urlencoded). 12 | 13 | Write a route that extracts data from the query string in the `GET /search URL route`, e.g. `?results=recent&include_tabs=true` and then outputs it back to the user in JSON format. 14 | 15 | Use `app.get('/search', function(){...})` for the route. 16 | 17 | In Express.js, to extract query string parameters, we can use (inside the request handler): 18 | 19 | ```javascript 20 | req.query.NAME 21 | ``` 22 | 23 | ## HINTS 24 | 25 | No need to install query middleware. It's part of the Express.js framework. 26 | 27 | To output JSON we can use: 28 | 29 | ```javascript 30 | res.send(object) 31 | ``` 32 | 33 | ## My Solution 34 | 35 | ```javascript 36 | var express = require('express'); 37 | var app = express(); 38 | var url = require('url'); 39 | 40 | app.get('/search', function(req, res) { 41 | var parsedURL = url.parse(req.url, true); 42 | res.send(JSON.stringify(parsedURL.query)); 43 | }); 44 | 45 | app.listen(process.argv[2]); 46 | ``` 47 | 48 | ## Official Solution: 49 | 50 | ```javascript 51 | var express = require('express') 52 | var app = express() 53 | 54 | app.get('/search', function(req, res) { 55 | var query = req.query 56 | res.send(query) 57 | }) 58 | 59 | app.listen(process.argv[2]) 60 | ``` 61 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Iterate-with-JavaScript-For-Loops.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Iterate with JavaScript For Loops 9 | You can run the same code multiple times by using a loop. 10 | 11 | The most common type of JavaScript loop is called a "for loop" because it runs "for" a specific number of times. 12 | 13 | For loops are declared with three optional expressions seperated by semicolons: 14 | 15 | `for([initialization]; [condition]; [final-expression])` 16 | 17 | The `initialization` statement is executed one time only before the loop starts. It is typically used to define and setup your loop variable. 18 | 19 | The `condition` statement is evaluated at the beginning of every loop iteration and will continue as long as it evalutes to `true`. When `condition` is `false` at the start of the iteration, the loop will stop executing. This means if `condition` starts as `false`, your loop will never execute. 20 | 21 | The `final-expression` is executed at the end of each loop iteration, prior to the next `condition` check and is usually used to increment or decrement your loop counter. 22 | 23 | In the following example we initialize with `i = 0` and iterate while our condition `i < 5` is true. We'll increment `i` by `1` in each loop iteration with `i++` as our `final-expression`. 24 | 25 | ```js 26 | var ourArray = []; 27 | 28 | for(var i = 0; i < 5; i++) { 29 | 30 | ourArray.push(i); 31 | 32 | } 33 | ``` 34 | ourArray will now contain `[0,1,2,3,4] 35 | `. 36 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Slasher-Flick.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Return the remaining elements of an array after chopping off n elements from the head. 12 | 13 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 14 | 15 | ## Useful Links 16 | - [Array.slice()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) 17 | - [Array.splice()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) 18 | 19 | ## Problem Script: 20 | 21 | ```js 22 | function slasher(arr, howMany) { 23 | // it doesn't always pay to be first 24 | return arr; 25 | } 26 | 27 | slasher([1, 2, 3], 2); 28 | ``` 29 | 30 | ## Explanation: 31 | We have to take an array and delete as many elements from the beginning as stated by the second parameter. 32 | 33 | ## Hint: 1 34 | It can be done in one line with slice. 35 | 36 | ## Hint: 2 37 | If you want you can try to use splice but slice is enough. 38 | 39 | ## Hint: 3 40 | Really? Splice by the number of the second parameter. 41 | 42 | ## My code: 43 | 44 | ```js 45 | function slasher(arr, howMany) { 46 | return arr.slice(howMany); 47 | } 48 | ``` 49 | 50 | ## My Code Explanation: 51 | Slice the array by the about of the second parameter. 52 | 53 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 54 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Use-Conditional-Logic-with-If-Statements.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Use Conditional Logic with If-Else Statements 9 | We can use if statements in JavaScript to only execute code if a certain condition is met. 10 | 11 | Each if statement requires a `boolean` condition to evaluate. If the _boolean_ evaluates to `true`, the statements inside the curly braces will execute. Otherwise, if it evaluates to `false`, the code will not execute. 12 | 13 | Example: 14 | 15 | ```js 16 | function test(myVal) { 17 | if (myVal > 10) { 18 | return "Greater Than"; 19 | } 20 | return "Not Greater Than"; 21 | } 22 | ``` 23 | 24 | If `myVal` is greater than 10, the function will return "Greater Than". If it is not, the function will return "Not Greater Than". 25 | 26 | Furthermore, if you add an `else` statement you can have it do something different in case that `myVal` is equal or less than 10 inthe following way: 27 | 28 | ```js 29 | function test(myVal) { 30 | if (myVal > 10) { 31 | return "Greater Than"; 32 | } else { 33 | // do something else 34 | } 35 | return "Not Greater Than"; 36 | } 37 | ``` 38 | 39 | You could take it even further and use an `else-if` and then another `else` for nesting once you are more familiar with conditions. 40 | 41 | ```js 42 | if (true) { 43 | // do something 44 | }else if (true) { 45 | // otherwise check this and do that 46 | }else { 47 | // otherwise do this instead 48 | } 49 | 50 | //consitune with more code here 51 | ``` 52 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/Express/Express-App-Static.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # Express App: Static 10 | 11 | Apply static middleware to serve `index.html` file without any routes. 12 | 13 | Your solution must listen on the port number supplied by `process.argv[2]`. 14 | 15 | The index.html file is provided and usable via the path supplied by process.argv[3]. However, you can use your own file with this content: 16 | 17 | ```html 18 | 19 | 20 | expressworks 21 | 22 | 23 | 24 |

    I am red!

    25 | 26 | 27 | ``` 28 | 29 | ## HINTS 30 | 31 | This is how you can call static middleware: 32 | 33 | ```javascript 34 | app.use(express.static(path.join(__dirname, 'public'))); 35 | ``` 36 | 37 | For this exercise expressworks will pass you the path: 38 | 39 | ```javascript 40 | app.use(express.static(process.argv[3]||path.join(__dirname, 'public'))); 41 | ``` 42 | 43 | ## My Solution 44 | 45 | ```javascript 46 | var express = require('express') 47 | var path = require("path") 48 | var app = express() 49 | app.use(express.static(process.argv[3])); 50 | app.listen(process.argv[2]) 51 | ``` 52 | 53 | ## Official Solution: 54 | 55 | ```javascript 56 | var path = require('path') 57 | var express = require('express') 58 | var app = express() 59 | 60 | app.use(express.static(process.argv[3]||path.join(__dirname, 'public'))); 61 | 62 | app.listen(process.argv[2]) 63 | ``` 64 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/Express/Express-App-Jademd: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # Express App: Jade 10 | 11 | Create an Express.js app with a home page rendered by Jade template engine. 12 | 13 | The homepage should respond to `/home`. 14 | 15 | The view should show the current date using `toDateString`. 16 | 17 | ## HINTS 18 | 19 | The Jade template file index.jade is already provided: 20 | 21 | ``` 22 | h1 Hello World 23 | p Today is #{date}. 24 | ``` 25 | 26 | This is how to specify path in a typical Express.js app when the folder is 'templates': 27 | 28 | ```javascript 29 | app.set('views', path.join(__dirname, 'templates')) 30 | ``` 31 | 32 | However, to use our index.jade, the path to index.jade will be provided as process.argv[3]. You are welcome to use your own jade file! 33 | 34 | To tell Express.js app what template engine to use, apply this line to the Express.js configuration: 35 | 36 | ```javascript 37 | app.set('view engine', 'jade') 38 | ``` 39 | 40 | Instead of Hello World's res.end(), the res.render() function accepts a template name and presenter data: 41 | 42 | ```javascript 43 | res.render('index', {date: new Date().toDateString()}) 44 | ``` 45 | 46 | We use `toDateString()` to simply return the date in a human-readable format without the time. 47 | 48 | ## My Solution 49 | 50 | You will need to install jade first: `npm install jade` 51 | 52 | ```javascript 53 | var express = require('express') 54 | var app = express() 55 | app.set('view engine', 'jade') 56 | app.set('views', process.argv[3]) 57 | app.get('/home', function(req, res) { 58 | res.render('index', {date: new Date().toDateString()}) 59 | }) 60 | app.listen(process.argv[2]) 61 | ``` 62 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Reverse-a-String.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Reverse the provided string. 12 | 13 | You may need to turn the string into an array before you can reverse it. 14 | 15 | Your result must be a string. 16 | 17 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 18 | 19 | ## Useful Links 20 | - [Global String Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) 21 | - [String.split()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) 22 | - [Array.join()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join) 23 | 24 | ## Problem Script: 25 | 26 | ```js 27 | function reverseString(str) { 28 | return str; 29 | } 30 | 31 | reverseString('hello'); 32 | ``` 33 | 34 | ## Explanation: 35 | You need to take the string and reverse it so if you had originally 'hello', it will turn into 'olleh'. Because you will need to split it, you will be working with Arrays too. 36 | 37 | ## Hint: 1 38 | You should split the string by characters. 39 | 40 | ## Hint: 2 41 | Find out about the built in function to reverse a string. 42 | 43 | ## Hint: 3 44 | Once you have split and reversed, do not forget to join them back into one string. 45 | 46 | ## My code: 47 | 48 | ```js 49 | function reverseString(str) { 50 | var strReverse = str.split('').reverse().join(''); 51 | return strReverse; 52 | } 53 | ``` 54 | 55 | ## My Code Explanation: 56 | This is a straightforward code. We create a variable that will hold the string split by characters, and then reversed and put back together. 57 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Confirm-the-Ending.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Check if a string (first argument) ends with the given target string (second argument). 12 | 13 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 14 | 15 | ## Useful Links 16 | - [String.substr()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) 17 | 18 | ## Problem Script: 19 | 20 | ```js 21 | function end(str, target) { 22 | // "Never give up and good luck will find you." 23 | // -- Falcor 24 | return str; 25 | } 26 | 27 | end('Bastian', 'n'); 28 | ``` 29 | 30 | ## Explanation: 31 | The function is a whole Boolean operation. You need to return true if the first argument ends with the second argument. This means that for the problem script, it should return true for the `end('Bastian', 'n'); case.` 32 | 33 | ## Hint: 1 34 | Take a look at how substr() works. You will be trying to get the last Nth characters. 35 | 36 | ## Hint: 2 37 | To get the Nth-to-Last character you will use length() and turn it into a negative number. 38 | 39 | ## Hint: 3 40 | Check that you have the proper syntax and that you use `===` to compare. 41 | 42 | ## My code: 43 | 44 | ```js 45 | function end(str, target) { 46 | return (str.substr(-target.length) === target); 47 | } 48 | ``` 49 | 50 | ## My Code Explanation: 51 | We use the subtring() with the negative value of the lengths of target. We could use -1 to get the last element but if the target is actually longer than one letter then the program will provide the wrong information. The we return true or false as needed. 52 | 53 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 54 | -------------------------------------------------------------------------------- /MangaDB.md: -------------------------------------------------------------------------------- 1 | # Notes on things I have learned along the way 2 | ## How to Run Code in Specific Page 3 | There regular way to run JavaScript when a page loads is with: 4 | 5 | ```js 6 | $(document).ready(callback); 7 | ``` 8 | 9 | However, whether you are using templates or plain HTML, you can specify the page you would like to run the code in by creating a condition to check the url path if you don't want to have a new script run on that specific page. 10 | 11 | ```js 12 | $(document).ready(function () { 13 | if (window.location.pathname == '/user/' + user.toLowerCase()) { 14 | getMangas(); 15 | }; 16 | }); 17 | ``` 18 | 19 | ## Implement Flash Messages with jade 20 | Flash messages allows the app to share important and useful information just once and they reside in flash memory. 21 | 22 | It is important to know that if you call it once to test, it will not work the second time. Once again, the message is displayed **once**. 23 | 24 | To implement it, you first need to install [connect-flash](https://www.npmjs.com/package/connect-flash). 25 | 26 | ```bash 27 | npm install --save connect-flash 28 | ``` 29 | 30 | This will save it to your `package.json` file where you will see something like this `"connect-flash": "^0.1.1"`. 31 | 32 | You will need to add the following to your server: 33 | 34 | ```js 35 | var flash = require('connect-flash'); 36 | app.use(flash()); 37 | ``` 38 | 39 | Then you can create a flash message in the following way: 40 | 41 | ```js 42 | req.flash('info', 'Flash is back!') 43 | ``` 44 | 45 | That is, identifier, and data. Just make sure that you put it before your `res` code. Then you display it with your render. 46 | 47 | ```js 48 | res.render('index', { messages: req.flash('info') }); 49 | ``` 50 | 51 | If you want multiple messages to be handled then you can use something like this in jade: 52 | 53 | ```jade 54 | .container-fluid 55 | if msg.error && msg.error.length 56 | .alert.alert-danger 57 | div= msg.error 58 | if msg.info && msg.info.length 59 | .alert.alert-info 60 | div= msg.info 61 | if msg.success && msg.success.length 62 | .alert.alert-success 63 | div= msg.success 64 | ``` 65 | 66 | To take advantage of bootstrap custom alert panels and to handle the case where there is no indo at all. 67 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Falsey-Bouncer.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Remove all falsey values from an array. 12 | 13 | Falsey values in javascript are false, null, 0, "", undefined, and NaN. 14 | 15 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 16 | 17 | ## Useful Links 18 | - [Boolean Objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) 19 | - [Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) 20 | 21 | ## Problem Script: 22 | 23 | ```js 24 | function bouncer(arr) { 25 | // Don't show a false ID to this bouncer. 26 | return arr; 27 | } 28 | 29 | bouncer([7, 'ate', '', false, 9]); 30 | ``` 31 | 32 | ## Explanation: 33 | Falsey values in javascript are false, null, 0, "", undefined, and NaN. Everything else is basically truthy. So if we find any falsey we have to filter then out. 34 | 35 | ## Hint: 1 36 | Filter() requires a callback function, you need to create it. 37 | 38 | ## Hint: 2 39 | You will return a boolean of the argument from the callback function, use `Boolean(arg)` 40 | 41 | ## Hint: 3 42 | If you figure out how to use filter and boolean then you are all set, if not then keep checking for the answer. 43 | 44 | ## My code: 45 | 46 | ```js 47 | function bouncer(arr) { 48 | function isTruthy(arg){ 49 | return Boolean(arg); 50 | } 51 | var filteredArray = arr.filter(isTruthy); 52 | return filteredArray; 53 | } 54 | ``` 55 | 56 | ## My Code Explanation: 57 | - Create a callback function that returns a boolean using the argument passed to it. 58 | - use that call back function with filter to filter the array and return the filtered array. 59 | 60 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 61 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/MongoDB/MongoDB-Count.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # MongoDB Count 10 | 11 | Here we will learn how to count the number of documents that meet certain criteria. 12 | 13 | Use the parrots collection to count all documents where age is greater than the first argument passed to your script. 14 | 15 | Using console.log, print the number to stdout. 16 | 17 | ## HINTS 18 | 19 | To count the number of documents meeting certain criteria, we must use the collection.count() function. 20 | 21 | Here is an example: 22 | 23 | ```javascript 24 | collection.count({ 25 | name: 'foo' 26 | }, function(err, count) { 27 | 28 | }) 29 | ``` 30 | 31 | If your program does not finish executing, you may have forgotten to close the db. That can be done by calling `db.close()` after you have finished. 32 | 33 | ## Resource 34 | 35 | - 36 | 37 | ## My Solution 38 | 39 | ```javascript 40 | var mongo = require('mongodb').MongoClient; 41 | var url = 'mongodb://localhost:27017/learnyoumongo'; 42 | 43 | mongo.connect(url, function(err, db) { 44 | if (err) throw err; 45 | var collection = db.collection('parrots'); 46 | collection.count({ 47 | age: { 48 | // greater than integer 49 | $gt: parseInt(process.argv[2]) 50 | } 51 | }, function(err, count) { 52 | if (err) throw err; 53 | console.log(count); 54 | db.close(); 55 | }) 56 | }) 57 | ``` 58 | 59 | ## Official Solution: 60 | 61 | ```javascript 62 | var mongo = require('mongodb').MongoClient 63 | var age = process.argv[2] 64 | 65 | var url = 'mongodb://localhost:27017/learnyoumongo' 66 | 67 | mongo.connect(url, function(err, db) { 68 | if (err) throw err 69 | var parrots = db.collection('parrots') 70 | parrots.count({ 71 | age: { 72 | $gt: +age 73 | } 74 | }, function(err, count) { 75 | if (err) throw err 76 | console.log(count) 77 | db.close() 78 | }) 79 | }) 80 | ``` 81 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Repeat-a-string-repeat-a-string.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Repeat a given string (first argument) n times (second argument). Return an empty string if n is a negative number. 12 | 13 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 14 | 15 | ## Useful Links 16 | - [Global String Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) 17 | 18 | ## Problem Script: 19 | 20 | ```js 21 | function repeat(str, num) { 22 | // repeat after me 23 | return str; 24 | } 25 | 26 | repeat('abc', 3); 27 | ``` 28 | 29 | ## Explanation: 30 | The program is very simple, we have to take a variable and return that variable being repeated certain amount of times. No need to add space or anything, just keep repeating it into one single string. 31 | 32 | ## Hint: 1 33 | You can't edit strings, you will need to create a variable to store the new string. 34 | 35 | ## Hint: 2 36 | Create a loop to repeated the code as many times as needed. 37 | 38 | ## Hint: 3 39 | Make the variable created store the current value and append the word to it. 40 | 41 | ## My code: 42 | 43 | ```js 44 | function repeat(str, num) { 45 | var accumulatedStr = ""; 46 | while (num > 0) { 47 | accumulatedStr += str; 48 | num--; 49 | } 50 | return accumulatedStr; 51 | } 52 | ``` 53 | 54 | ## My Code Explanation: 55 | - Create a variable to store the repeated word. 56 | - Use a while loop or for loop to repeat code as many times as needed according to `num` 57 | - The we just have to add the string to the variable created on step one. and increase or decrease num depending on how you set the loop. 58 | - At the end of the loop, return the variable for the repeated word. 59 | 60 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 61 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/Express/Express-App-JSON-Me.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # Express App: JSON Me 10 | 11 | Most of the times we're building RESTful API servers with JSON. 12 | 13 | Write a server that, when it receives a GET, reads a file, parses it to JSON, and responds with that content to the user. 14 | 15 | The server should respond to any GET that matches the /books resource path. As always, the port is passed in `process.argv[2]`. The file to read is passed in `process.argv[3]`. 16 | 17 | Respond with: 18 | 19 | ```javascript 20 | res.json(object) 21 | ``` 22 | 23 | Everything should match the /books resource path. 24 | 25 | For reading the file, use the fs module, e.g., 26 | 27 | ```javascript 28 | fs.readFile(filename, callback) 29 | ``` 30 | 31 | ## HINTS 32 | 33 | While the parsing can be done with JSON.parse: 34 | 35 | ```javascript 36 | object = JSON.parse(string) 37 | ``` 38 | 39 | No need to install the fs module. It's part of the core and the Node.js platform. 40 | 41 | ## My Solution 42 | 43 | ```javascript 44 | var express = require('express'); 45 | var fs = require("fs"); 46 | var app = express(); 47 | app.set('json spaces', 0) 48 | app.get('/books', function(req, res) { 49 | fs.readFile(process.argv[3], 'utf8', function(err, data) { 50 | if (err) throw err; 51 | var out = JSON.parse(data); 52 | res.json(out) 53 | }); 54 | 55 | }); 56 | 57 | app.listen(process.argv[2]); 58 | ``` 59 | 60 | ## Official Solution (Not working on c9) 61 | 62 | ```javascript 63 | var express = require('express') 64 | var app = express() 65 | var fs = require('fs') 66 | 67 | app.get('/books', function(req, res) { 68 | var filename = process.argv[3] 69 | fs.readFile(filename, function(e, data) { 70 | 71 | if (e) return res.sendStatus(500) 72 | try { 73 | books = JSON.parse(data) 74 | } catch (e) { 75 | res.sendStatus(500) 76 | } 77 | res.json(books) 78 | }) 79 | }) 80 | 81 | app.listen(process.argv[2]) 82 | ``` 83 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Chunky-Monkey.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array. 12 | 13 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 14 | 15 | ## Useful Links 16 | - [Array.push()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) 17 | 18 | ## Problem Script: 19 | 20 | ```js 21 | function chunk(arr, size) { 22 | // Break it up. 23 | return arr; 24 | } 25 | 26 | chunk(['a', 'b', 'c', 'd'], 2); 27 | ``` 28 | 29 | ## Explanation: 30 | You need to take an array from the first parameter, and then make sub-arrays the size of the second parameter and return them inside a big array. 31 | 32 | ## Hint: 1 33 | You will need two extra variables to store temp values and the new arrays. 34 | 35 | ## Hint: 2 36 | You need to check if you already have enough elements or not and add them. 37 | 38 | ## Hint: check 39 | You will need to check if there is any elements to push before returning the final results. 40 | 41 | ## My code: 42 | 43 | ```js 44 | var temp = []; 45 | var result = []; 46 | 47 | for (var a in arr) { 48 | if (a % size !== size - 1) 49 | temp.push(arr[a]); 50 | else { 51 | temp.push(arr[a]); 52 | result.push(temp); 53 | temp = []; 54 | } 55 | } 56 | 57 | if (temp.length !== 0) 58 | result.push(temp); 59 | return result; 60 | } 61 | ``` 62 | 63 | ## My Code Explanation: 64 | - Create a temp variable and an results variable. 65 | - For every element in the array: 66 | - if the index of the element is even then add the element temp variable. 67 | - Otherwise it means that we already have an element and should add the element and flush temp into results. 68 | 69 | - Outside the loop, we check if temp is empty and return accordingly. 70 | 71 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 72 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Truncate-a-string.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending. 12 | 13 | Note that the three dots at the end add to the string length. 14 | 15 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 16 | 17 | ## Useful Links 18 | - [String.slice()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) 19 | 20 | ## Problem Script: 21 | 22 | ```js 23 | function truncate(str, num) { 24 | // Clear out that junk in your trunk 25 | return str; 26 | } 27 | 28 | truncate('A-tisket a-tasket A green and yellow basket', 11); 29 | ``` 30 | 31 | ## Explanation: 32 | We need to reduce the length of the string or **truncate** it if it is longer than the given maximum lengths specified and add `...` to the end. If it is not that long then we keep it as is. 33 | 34 | ## Hint: 1 35 | Strings are immutable in JavaScript so we will need a new variable to store the truncated string. 36 | 37 | ## Hint: 2 38 | You will need to use slice and specify where to start and where to stop. 39 | 40 | ## Hint: 3 41 | Do not forget that when we truncate the word, we also must count the length added by `...` 42 | 43 | ## My code: 44 | 45 | ```js 46 | function truncate(str, num) { 47 | var truncd = ''; 48 | if (str.length > num) { 49 | truncd = str.slice(0,num-3) + '...'; 50 | return truncd; 51 | } 52 | return str; 53 | } 54 | ``` 55 | 56 | ## My Code Explanation: 57 | - Create a variable `truncd` to store the truncated string. 58 | - Check to see if the string needs to be truncated. 59 | - If so, then slice the string and make sure you include the three dots. 60 | - Return the truncated word or the original string if it didn't need to be truncated. 61 | 62 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 63 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Factorialize-a-Number.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Return the factorial of the provided integer. 12 | 13 | If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n. 14 | 15 | Factorials are often represented with the shorthand notation n! 16 | 17 | For example: `5! = 1 * 2 * 3 * 4 * 5 = 120f` 18 | 19 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 20 | 21 | ## Useful Links 22 | - [Arithmetic Operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators) 23 | 24 | ## Problem Script: 25 | 26 | ```js 27 | function factorialize(num) { 28 | return num; 29 | } 30 | 31 | factorialize(5); 32 | ``` 33 | 34 | ## Explanation: 35 | This problem is very straightforward, yet it has two possible ways to get the solution. 36 | 1. `for` loops. 37 | 2. Recursion. 38 | 39 | ## Hint: 1 40 | You need to take the number and multiply it for one less until you get to one. 41 | 42 | ## Hint: 2 43 | You can use a for loop and have a variable store the product of the current value and one less than it. 44 | 45 | ## Hint: 3 46 | Remember the control, the last number has to be `1` and the initial number should be minimum 2, if one then return it, otherwise handle the error. 47 | 48 | ## My code: 49 | 50 | ```js 51 | function factorialize(num) { 52 | var factorial = 1; 53 | for (var n = 2; n <= num; n++) { 54 | factorial = factorial * n; 55 | } 56 | 57 | return factorial; 58 | } 59 | ``` 60 | 61 | ## My Code Explanation: 62 | I decided to use the loop option. Because any number by one is the same number, we don't need to cover one. So we start with two and increase to the number, since the property of multiplication allows us to start in any order it works by multiplying the current number which is 1 by default by the value of n. 63 | 64 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 65 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Find-the-Longest-Word-in-a-String.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Return the length of the longest word in the provided sentence. 12 | 13 | Your response should be a number. 14 | 15 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 16 | 17 | ## Useful Links 18 | - [String.split()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) 19 | - [String.length](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) 20 | 21 | ## Problem Script: 22 | 23 | ```js 24 | function findLongestWord(str) { 25 | return str.length; 26 | } 27 | 28 | findLongestWord('The quick brown fox jumped over the lazy dog'); 29 | ``` 30 | 31 | ## Explanation: 32 | You have to go through each word and figure out which one is the longest and return not the word, but how many characters does it has. 33 | 34 | ## Hint: 1 35 | You should split the string into an array of words. 36 | 37 | ## Hint: 2 38 | You will need to figure out a way to keep track globally of the greatest current length. 39 | 40 | ## Hint: 3 41 | Remember how to get the length of elements on the array? `Array[index].length` 42 | 43 | ## My code: 44 | 45 | ```js 46 | function findLongestWord(str) { 47 | var words = str.split(' '); 48 | var maxLength = 0; 49 | 50 | for (var i = 0; i < words.length; i++) { 51 | if (words[i].length > maxLength) { 52 | maxLength = words[i].length; 53 | } 54 | } 55 | 56 | return maxLength; 57 | } 58 | ``` 59 | 60 | ## My Code Explanation: 61 | Take the string and convert it into an array of words. Declare a variable to keep track of the maximum length and loop from 0 to the length of the array of words. 62 | 63 | Then check for the longest word by comparing the current word to the previous one and storing the new longest word. At the end of the loop just return the number value of the variable maxLength. 64 | 65 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 66 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Check-for-Palindromes.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Return true if the given string is a palindrome. Otherwise, return false. 12 | 13 | A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing. 14 | 15 | You'll need to remove punctuation and turn everything lower case in order to check for palindromes. 16 | 17 | We'll pass strings with varying formats, such as "racecar", "RaceCar", and "race CAR" among others. 18 | 19 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 20 | 21 | ## Useful Links 22 | - [String.replace()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) 23 | - [String.toLowerCase()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) 24 | 25 | ## Problem Script: 26 | 27 | ```js 28 | function palindrome(str) { 29 | // Good luck! 30 | return true; 31 | } 32 | palindrome("eye"); 33 | ``` 34 | 35 | ## Explanation: 36 | You have to check if the string you get as an input is a palindrome and return true if it is, and false otherwise. 37 | 38 | ## Hint: 1 39 | Make sure to turn the string to lowercase. 40 | 41 | ## Hint: 2 42 | You will need to use split() and join() 43 | 44 | ## Hint: 3 45 | Using regular expressions to change to lowercase will make things easier and the code simpler. 46 | 47 | ## My code: 48 | 49 | ```Javascript 50 | function palindrome(str) { 51 | var normalizedStr = str.replace(/[\W_]/g, '').toLowerCase(); 52 | var reverseStr = normalizedStr.split('').reverse().join(''); 53 | return normalizedStr === reverseStr; 54 | } 55 | ``` 56 | 57 | ## My Code Explanation: 58 | We use regular expressions to replace any uppercase letter into a lowercase. Then we check if the string is the same as the reversed string using `split()` to split the original string by characters, then reverse and then join it back together. 59 | 60 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 61 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Intermediate-Algorithm-Scripting/Bonfire-Boo-who.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 2/5 10 | 11 | Check if a value is classified as a boolean primitive. Return true or false. 12 | 13 | Boolean primitives are true and false. 14 | 15 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 16 | 17 | ## Useful Links 18 | - [Boolean Objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) 19 | 20 | ## Problem Script: 21 | 22 | ```js 23 | function boo(bool) { 24 | // What is the new fad diet for ghost developers? The Boolean. 25 | return bool; 26 | } 27 | 28 | boo(null); 29 | ``` 30 | 31 | # Problem Explanation: 32 | - This program is very simple, the trick is to understand what a boolean primitive is. The programs requires a true or false answer. 33 | 34 | ## Hint: 1 35 | - You will need to check for the type of the parameter to see if it is a boolean. 36 | 37 | ## Hint: 2 38 | - To check for the type of a parameter, you can use `typeof` 39 | 40 | ## Hint: 3 41 | - Since you must return true or false you can use if statements or just have it return the boolean used for the if statement. 42 | 43 | ## Spoiler Alert! 44 | [![687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif](https://files.gitter.im/FreeCodeCamp/Wiki/nlOm/thumb/687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif)](https://files.gitter.im/FreeCodeCamp/Wiki/nlOm/687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif) 45 | 46 | **Solution ahead!** 47 | 48 | ## Code Solution: 49 | 50 | ```js 51 | function boo(bool) { 52 | // Uses the operator typeof to check if is a boolean 53 | // if yes then return true, if it is another type then return false 54 | return typeof bool === 'boolean'; 55 | } 56 | ``` 57 | 58 | # Code Explanation: 59 | - Read comments on code. 60 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Where-do-I-belong.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument). 12 | 13 | For example, where([1,2,3,4], 1.5) should return 1 because it is greater than 1 (0th index), but less than 2 (1st index). 14 | 15 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 16 | 17 | ## Useful Links 18 | - [Array.sort()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) 19 | 20 | ## Problem Script: 21 | 22 | ```js 23 | function where(arr, num) { 24 | // Find my place in this sorted array. 25 | return num; 26 | } 27 | 28 | where([40, 60], 50); 29 | ``` 30 | 31 | ## Explanation: 32 | This can be a tricky problem to understand. You need to find where in the array a number should be inserted by order, and return the index where it should go. 33 | 34 | ## Hint: 1 35 | The first thing to do is sort the array from lower to bigger, just to make the code easier. This is where sort comes in, it needs a callback function so you have to create it. 36 | 37 | ## Hint: 2 38 | Once the array is sorted, then just check for the first number that is bigger and return the index. 39 | 40 | ## Hint: 3 41 | If there is no index for that number then you will have to deal with that case too. 42 | 43 | ## My code: 44 | 45 | ```js 46 | function where(arr, num) { 47 | arr.sort(function(a, b) { 48 | return a - b; 49 | }); 50 | for (var a in arr){ 51 | if (arr[a] >= num) 52 | return parseInt(a); 53 | } 54 | return arr.length; 55 | } 56 | ``` 57 | 58 | ## My Code Explanation: 59 | - First I sort the array using `.sort(callbackFuntion)` to sort it by lowest to highest, from left to right. 60 | - Then I use a for loop to compare the items in the array starting from the smallest one. When an item on the array is greater than the number we are comparing against, then we return the index as an integer. 61 | 62 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 63 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/MongoDB/MongoDB-Rounding.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # MongoDB Rounding 10 | 11 | The Number prototype contains a function `toFixed()`, which accepts the number of decimal places you would like to round to, and returns a string representation. 12 | 13 | ```javascript 14 | var value = "1" 15 | Number(value).toFixed(5) 16 | // => '1.00000' 17 | ``` 18 | 19 | If your program does not finish executing, you may have forgotten to close the db. That can be done by calling db.close() after you have finished. 20 | 21 | ## Resources 22 | 23 | - 24 | - 25 | 26 | ## My Solution 27 | 28 | ```javascript 29 | var mongo = require('mongodb').MongoClient; 30 | var url = 'mongodb://localhost:27017/learnyoumongo'; 31 | 32 | mongo.connect(url, function(err, db) { 33 | if (err) throw err; 34 | var collection = db.collection('prices'); 35 | collection.aggregate([ 36 | { $match: { size: process.argv[2] } } 37 | , { $group: { 38 | _id: 'total' // This can be an arbitrary string in this case 39 | , total: { 40 | // $sum is the operator used here 41 | $avg: '$price' 42 | } 43 | }} 44 | ]).toArray(function(err, results) { 45 | // handle error 46 | if (err) throw err 47 | console.log(Number(results[0].total).toFixed(2)) 48 | db.close() 49 | }) 50 | }) 51 | ``` 52 | 53 | ## Official Solution: 54 | 55 | ```javascript 56 | var mongo = require('mongodb').MongoClient 57 | var size = process.argv[2] 58 | 59 | var url = 'mongodb://localhost:27017/learnyoumongo' 60 | 61 | mongo.connect(url, function(err, db) { 62 | if (err) throw err 63 | var prices = db.collection('prices') 64 | prices.aggregate([{ 65 | $match: { 66 | size: size 67 | } 68 | }, { 69 | $group: { 70 | _id: 'total', 71 | total: { 72 | $avg: '$price' 73 | } 74 | } 75 | }]).toArray(function(err, results) { 76 | if (err) throw err 77 | if (!results.length) { 78 | throw new Error('No results found') 79 | } 80 | var o = results[0] 81 | console.log(Number(o.total).toFixed(2)) 82 | db.close() 83 | }) 84 | }) 85 | ``` 86 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Intermediate-Algorithm-Scripting/Bonfire-Drop-it.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [My Original Wiki](http://rafase282.github.io/My-FreeCodeCamp-Code/) 7 | 8 | # Details 9 | - Difficulty: 2/5 10 | 11 | Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true. 12 | 13 | Remember to use [RSAP](http://www.freecodecamp.com/field-guide/how-do-i-get-help-when-I-get-stuck) if you get stuck. Try to pair program. Write your own code. 14 | 15 | # Useful Links 16 | - [Arguments object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments) 17 | - [Array.shift()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) 18 | 19 | # Problem Script: 20 | 21 | ```js 22 | function drop(arr, func) { 23 | // Drop them elements. 24 | return arr; 25 | } 26 | 27 | drop([1, 2, 3], function(n) {return n < 3; }); 28 | ``` 29 | 30 | ## Explanation: 31 | Basically while the second argument is not true, you will have to remove the first element from the left of the array that was passed as the first argument. 32 | 33 | ## Hint: 1 34 | You can use Array.shift() or filter that you should be more familiar with to solve this problem in a few lines of code. 35 | 36 | ## Hint: 2 37 | Shift returns the element that was removed which we don't really need, all we need is the modified array that is left. 38 | 39 | ## Hint: 3 40 | If you still can't figure out how to solve it with shift, then try solving it with filter, and check how filter works, if you become familiar with it, then you can make the code with shift. 41 | 42 | ## Code Solution: 43 | 44 | ```js 45 | Code from Max Helmetag (https://github.com/mhelmetag) 46 | 47 | function drop(arr, func) { 48 | var times = arr.length; 49 | for (var i = 0; i < times; i++) { 50 | if (func(arr[0])) { 51 | break; 52 | } else { 53 | arr.shift(); 54 | } 55 | } 56 | 57 | return arr; 58 | } 59 | 60 | drop([1, 2, 3], function(n) {return n < 3; }); 61 | ``` 62 | 63 | ## My Code Explanation: 64 | - Create a for loop to check each element. 65 | - Then check for the function given if true then stop, otherwise remove that element. 66 | - return the array. 67 | 68 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 69 | -------------------------------------------------------------------------------- /Angular/Lesson-Get-Started-with-Angular.js.md: -------------------------------------------------------------------------------- 1 | # Creating Modules 2 | To create a module we first create a variable for the app, then we will use the angular library to create a module, we give it a name and an array of dependencies, it can be an empty array if there are no dependencies. 3 | 4 | ```js 5 | var app = angular.module('store', []); 6 | ``` 7 | 8 | Don't forget to add the library to the html though. 9 | 10 | # Including the module 11 | This is very simple, you just have to add it as any other script or library, add a link to the `` 12 | 13 | ```html 14 | 15 | 16 | 17 | ``` 18 | 19 | Then on the `` tag we include `np-app="store"` 20 | 21 | # Expressions 22 | They allows us to insert dynamic values into our HTML. 23 | 24 | ```html 25 |

    26 | I am {{4 + 6}} 27 |

    28 | ``` 29 | 30 | This will be the same as `

    I am 10

    ` 31 | 32 | It also works for strings too. There are more examples [here.](http://docs.angularjs.org/guide/expression) 33 | 34 | # Controllers 35 | Controllers are where we define out app's behavior by defining functions and values. 36 | 37 | ```js 38 | (function(){ 39 | var app = angular.module('store', []); 40 | 41 | app.controller('StoreController', function(){ 42 | this.product = gem; 43 | }); 44 | })(); 45 | ``` 46 | 47 | This will do the magic in this scope only. 48 | 49 | ```html 50 |
    51 |

    {{store.product.name}}

    //display the name 52 |

    ${{store.product.price}}

    //display price 53 |

    {{store.product.description}}

    //displays description 54 |
    55 | ``` 56 | 57 | # Show and Hide Buttons 58 | 59 | ```html 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
    69 |

    70 | {{store.product.name}} 71 | ${{store.product.price}} 72 |

    73 | 74 |
    75 | 76 | 77 | ``` 78 | 79 | ```js 80 | (function() { 81 | var app = angular.module('gemStore', []); 82 | 83 | app.controller('StoreController', function(){ 84 | this.product = gem; 85 | }); 86 | 87 | var gem = { 88 | name: 'Azurite', 89 | price: 110.50, 90 | canPurchase: false, 91 | soldOut: true 92 | }; 93 | })(); 94 | ``` 95 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Title-Case-a-Sentence.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: #/5 10 | 11 | Return the provided string with the first letter of each word capitalized. 12 | 13 | For the purpose of this exercise, you should also capitalize connecting words like 'the' and 'of'. 14 | 15 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 16 | 17 | ## Useful Links 18 | - [String.charAt()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt) 19 | 20 | ## Problem Script: 21 | 22 | ```js 23 | function titleCase(str) { 24 | return str; 25 | } 26 | 27 | titleCase("I'm a little tea pot"); 28 | ``` 29 | 30 | ## Explanation: 31 | We have to return a sentence with camel case. This means that the first letter will always be in uppercase and the rest lowercase. 32 | 33 | ## Hint: 1 34 | You should start by splitting the string into an array of words. 35 | 36 | ## Hint: 2 37 | You should make the word lowercase before making the first letter uppercase. 38 | 39 | ## Hint: 3 40 | You will need to create a new string with pieces of the previous one and at the end merge everythign into a single string again. 41 | 42 | ## My code: 43 | 44 | ```js 45 | String.prototype.replaceAt = function(index, character) { 46 | return this.substr(0, index) + character + this.substr(index+character.length); 47 | }; 48 | 49 | 50 | function titleCase(str) { 51 | var newTitle = str.split(' '); 52 | var updatedTitle = []; 53 | for (var st in newTitle) { 54 | updatedTitle[st] = newTitle[st].toLowerCase().replaceAt(0, newTitle[st].charAt(0).toUpperCase()); 55 | } 56 | return updatedTitle.join(' '); 57 | } 58 | ``` 59 | 60 | ## My Code Explanation: 61 | We are modifying the `replaceAt` function using prototype to facilitate the use of the program. 62 | 63 | Split the string by whitespaces, and create a variable to track the updated title. Then we use a loop to turn turn the first character of the word to uppercase and the rest to lowercase. by creating concatenated string composed of the whole word in lowercase with the first character replaced by it's uppercase. 64 | 65 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 66 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Review-Shopping-List.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | ## Instructions 9 | Create a shopping list in the variable `myList`. The list should be a multi-dimensional array containing several sub-arrays. 10 | 11 | The first element in each sub-array should contain a string with the name of the item. The second element should be a number representing the quantity. 12 | 13 | `["Chocolate Bar", 15]` 14 | 15 | There should be at least 5 sub-arrays in the list. 16 | 17 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 18 | 19 | ## Useful Link 20 | - [Lesson: Nest one Array within Another Array](http://www.freecodecamp.com/challenges/nest-one-array-within-another-array) 21 | 22 | ## Problem Explanation: 23 | - `myList` should be an array. 24 | - The first elements in each of your sub-arrays must all be strings. 25 | - The second elements in each of your sub-arrays must all be numbers. 26 | - You must have at least 5 items in your list. 27 | 28 | ## Hint: 1 29 | - A multi-dimensional array would have the following outline `[[]]` 30 | 31 | ## Hint: 2 32 | - Each sub-array should be separated by `,` as would any item in an array. 33 | 34 | ## Hint: 3 35 | - Don't forget the `;` at the end of your declaration. 36 | 37 | ## Spoiler Alert! 38 | [![687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif](https://files.gitter.im/FreeCodeCamp/Wiki/nlOm/thumb/687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif)](https://files.gitter.im/FreeCodeCamp/Wiki/nlOm/687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif) 39 | 40 | **Solution ahead!** 41 | 42 | ## Code Solution: 43 | 44 | ```js 45 | var myList = [["Canned Beans", 3],["Milk Galon", 1],["Cereal", 2],["Toilet Paper", 12],["Sack of Rice", 1]]; 46 | 47 | } 48 | ``` 49 | 50 | # Code Explanation: 51 | - Created an array that has five arrays inside composed of a string and an integer in that order. 52 | 53 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 54 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/Express/Express-App-Stylish-CSS.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # Express App: Stylish CSS 10 | 11 | HTML without styles is boring so this exercise will teach you how to use Stylus with Express on the fly. 12 | 13 | Style the HTML from the "STATIC" exercise using Stylus middleware. Stylus generates .css files on-the-fly from .styl files. 14 | 15 | Your solution should listen on the port supplied by `process.argv[2]` for GET requests, one of which will be for main.css, which should be automatically generated by your Stylus middleware. index.html and main.styl can be found in `process.argv[3]` (they are in the same directory). 16 | 17 | You could also create your own folder and use these, if you like: 18 | 19 | The main.styl file: 20 | 21 | ```sass 22 | p 23 | color red 24 | ``` 25 | 26 | The index.html file: 27 | 28 | ```html 29 | 30 | 31 | expressworks 32 | 33 | 34 | 35 |

    I am red!

    36 | 37 | 38 | ``` 39 | 40 | ## HINTS 41 | 42 | You'll want to plug in some stylus middleware using app.use again. It'll look something like this: 43 | 44 | ```javascript 45 | app.use(require('stylus').middleware('/path/to/*.styl' )) 46 | ``` 47 | 48 | In addition to producing in the "STATIC" exercise, you'll need to serve static files. Remember that middleware is executed in the order app.use is called! 49 | 50 | ## NOTE 51 | 52 | For your own projects, Stylus needs to be installed like any other dependency: 53 | 54 | ``` 55 | $ npm install stylus 56 | ``` 57 | 58 | ## My Solution 59 | 60 | ```javascript 61 | var express = require('express'); 62 | var app = express(); 63 | 64 | app.use(require('stylus').middleware(process.argv[3])); 65 | app.use(express.static(process.argv[3])); 66 | // This will display the main.styl content, not needed. 67 | app.get(process.argv[3], function(req, res) { 68 | res.render('main'); 69 | }); 70 | 71 | app.listen(process.argv[2]); 72 | ``` 73 | 74 | ## Official Solution: 75 | 76 | ```javascript 77 | var express = require('express') 78 | var app = express() 79 | 80 | app.use(require('stylus').middleware(process.argv[3])); 81 | app.use(express.static(process.argv[3])); 82 | 83 | app.listen(process.argv[2]) 84 | ``` 85 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Intermediate-Algorithm-Scripting/Bonfire-Spinal-Tap-Case.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 2/5 10 | 11 | Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes. 12 | 13 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 14 | 15 | ## Useful Links 16 | - [RegExp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) 17 | - [String.replace()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) 18 | 19 | ## Problem Script: 20 | 21 | ```js 22 | function spinalCase(str) { 23 | // "It's such a fine line between stupid, and clever." 24 | // --David St. Hubbins 25 | return str; 26 | } 27 | 28 | spinalCase('This Is Spinal Tap'); 29 | ``` 30 | 31 | # Problem Explanation: 32 | - Convert the given string to an all lowercase sentence joined by dashes. 33 | 34 | ## Hint: 1 35 | - Create a regex to for all white spaces and underscores. 36 | 37 | ## Hint: 2 38 | - You will also have to make everything lowercase. 39 | 40 | ## Hint: 3 41 | - The tricky part is getting the regex part to work, once you do that then just turn the uppercase to lowercase and replace spaces with underscores using `replace()` 42 | 43 | ## Spoiler Alert! 44 | [![687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif](https://files.gitter.im/FreeCodeCamp/Wiki/nlOm/thumb/687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif)](https://files.gitter.im/FreeCodeCamp/Wiki/nlOm/687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif) 45 | 46 | **Solution ahead!** 47 | 48 | ## Code Solution: 49 | 50 | ```js 51 | function spinalCase(str) { 52 | // Create a variable for the white space and underscores. 53 | var regex = /\s+|_+/g; 54 | 55 | // Replace low-upper case to low-space-uppercase 56 | str = str.replace(/([a-z])([A-Z])/g, '$1 $2'); 57 | 58 | // Replace space and underscore with - 59 | return str.replace(regex, '-').toLowerCase(); 60 | } 61 | ``` 62 | 63 | # Code Explanation: 64 | - Read comments in code. 65 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/MongoDB/MongoDB-Find-Project.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # MongoDB Find Project 10 | 11 | Here we will learn how to search for documents but only fetch the fields we need. Also known as projection in MongoDB 12 | 13 | Use the parrots collection to find all documents where age is greater than the first argument passed to your script. 14 | 15 | The difference from the last lesson will be that we only want the name and age properties 16 | 17 | Using `console.log`, print the documents to `stdout`. 18 | 19 | ## HINTS 20 | 21 | To find a document or documents, one needs to call find() on the collection. 22 | 23 | Find is a little bit different than what we are used to seeing. 24 | 25 | Here is an example: 26 | 27 | ```javascript 28 | collection.find({ 29 | name: 'foo' 30 | }, { 31 | name: 1 32 | , age: 1 33 | , _id: 0 34 | }).toArray(function(err, documents) { 35 | 36 | }) 37 | ``` 38 | 39 | If your program does not finish executing, you may have forgotten to close the db. That can be done by calling `db.close()` after you have finished. 40 | 41 | ## Resource: 42 | 43 | - 44 | 45 | ## My Solution 46 | 47 | ```javascript 48 | var url = 'mongodb://localhost:27017/learnyoumongo' 49 | var mongo = require('mongodb').MongoClient 50 | mongo.connect(url, function(err, db) { 51 | if (err) throw err 52 | // db gives access to the database 53 | db.collection('parrots').find({ 54 | age: { 55 | $gt: parseInt(process.argv[2]) 56 | } 57 | }, { 58 | name: 1, 59 | age: 1, 60 | _id: 0 61 | 62 | }).toArray(function(err, documents) { 63 | // Here is where we decide what to do with the query results 64 | if (err) throw err 65 | console.log(documents) 66 | db.close() 67 | }) 68 | }) 69 | ``` 70 | 71 | ## Official Solution: 72 | 73 | ```javascript 74 | var mongo = require('mongodb').MongoClient 75 | var age = process.argv[2] 76 | 77 | var url = 'mongodb://localhost:27017/learnyoumongo' 78 | 79 | mongo.connect(url, function(err, db) { 80 | if (err) throw err 81 | var parrots = db.collection('parrots') 82 | parrots.find({ 83 | age: { 84 | $gt: +age 85 | } 86 | }, { 87 | name: 1, 88 | age: 1, 89 | _id: 0 90 | }).toArray(function(err, docs) { 91 | if (err) throw err 92 | console.log(docs) 93 | db.close() 94 | }) 95 | }) 96 | ``` 97 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Seek-and-Destroy.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments. 12 | 13 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 14 | 15 | ## Useful Links 16 | - [Arguments object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments) 17 | - [Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) 18 | 19 | ## Problem Script: 20 | 21 | ```js 22 | function destroyer(arr) { 23 | // Remove all the values 24 | return arr; 25 | } 26 | 27 | destroyer([1, 2, 3, 1, 2, 3], 2, 3); 28 | ``` 29 | 30 | ## Explanation: 31 | This problem is a bit tricky because you have to familiarize yourself with Arguments, as you will have to work with two **or more** but on the script you only see two. Many people hardcode this program for three arguments. You will remove any number from the first argument that is the same as any other other arguments. 32 | 33 | ## Hint: 1 34 | You need to work with `arguments` as if it was a regular array. The best way is to convert it into one. 35 | 36 | ## Hint: 2 37 | You need to filter, this also means you need to create a callback function, one that checks if the element is on the `indexOf()` 38 | 39 | ## Hint: 3 40 | To convert `arguments` into an array use this code `var args = Array.prototype.slice.call(arguments);` 41 | 42 | ## My code: 43 | 44 | ```js 45 | function destroyer(arr) { 46 | var args = Array.prototype.slice.call(arguments); 47 | args.splice(0,1); 48 | return arr.filter(function(element) { 49 | return args.indexOf(element) === -1; 50 | }); 51 | } 52 | ``` 53 | 54 | ## My Code Explanation: 55 | - The first line will turn the `arguments` variable into a full array instead of the limited array it currently it. 56 | - Next I remove the first argument since I don't need, since I only want the other arguments passed besides the first which is the array we are going to compare against. 57 | - The use the `filter()` to filter out the elements that are on the array and keep the ones that are not. 58 | 59 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 60 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-JavaScript/Lesson-Review-Convert-Celsius-to-Fahrenheit.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32. 10 | 11 | You are given a variable `celsius` representing a temperature in Celsius. Create a variable `fahrenheit` and apply the algorithm to assign it the corresponding temperature in Fahrenheit. 12 | 13 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 14 | 15 | ## Useful Links 16 | - [The Order of Operations: PEMDAS](http://www.purplemath.com/modules/orderops.htm) 17 | - [Order of Operation: Video](https://www.khanacademy.org/math/pre-algebra/order-of-operations/order_of_operations/v/order-of-operations) 18 | 19 | ## Problem Explanation: 20 | - Explain what is asked in an easy to understand way. 21 | 22 | ## Hint: 1 23 | - Take a look at the code, there is an area that yoya re not supposed to edit, from there ask yourself, what is used there that I don't see before? 24 | 25 | ## Hint: 2 26 | - Keep in mind the `order of operation` check the link in the _link_ section for more information. 27 | 28 | ## Spoiler Alert! 29 | [![687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif](https://files.gitter.im/FreeCodeCamp/Wiki/nlOm/thumb/687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif)](https://files.gitter.im/FreeCodeCamp/Wiki/nlOm/687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif) 30 | 31 | **Solution ahead!** 32 | 33 | ## Code Solution: 34 | 35 | ```js 36 | function convert(celsius) { 37 | // Only change code below this line 38 | var fahrenheit = (celsius * (9/5)) + 32; 39 | 40 | // Only change code above this line 41 | if ( typeof fahrenheit !== 'undefined' ) { 42 | return fahrenheit; 43 | } else { 44 | return 'fahrenheit not defined'; 45 | } 46 | } 47 | 48 | // Change the inputs below to test your code 49 | convert(30); 50 | ``` 51 | 52 | # Code Explanation: 53 | - Make sure the proper order is followed with arithmetic using `()` when needed. 54 | - Declare the `fahrenheit` variable. 55 | 56 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 57 | -------------------------------------------------------------------------------- /Front-End-Development-Certification/Basic-Algorithm-Scripting/Bonfire-Return-Largest-Numbers-in-Arrays.md: -------------------------------------------------------------------------------- 1 | # Author 2 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 3 | 4 | Created by Rafase282 5 | 6 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 7 | 8 | # Details 9 | - Difficulty: 1/5 10 | 11 | Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays. 12 | 13 | Remember, you can iterate through an array with a simple for loop, and access each member with array syntax arr[i] . 14 | 15 | If you are writing your own Chai.js tests, be sure to use a deep equal statement instead of an equal statement when comparing arrays. 16 | 17 | Remember to use [ Read-Search-Ask](http://github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck) if you get stuck. Try to pair program. Write your own code. 18 | 19 | ## Useful Links 20 | - [Comparison Operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators) 21 | 22 | ## Problem Script: 23 | 24 | ```js 25 | function largestOfFour(arr) { 26 | // You can do this! 27 | return arr; 28 | } 29 | 30 | largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]); 31 | ``` 32 | 33 | ## Explanation: 34 | You will get an array that contains sub arrays of numbers and you need to return an array with the largest number from each of the sub arrays. 35 | 36 | ## Hint: 1 37 | You will need to keep track of the array with the answer and the largest number of each sub-array. 38 | 39 | ## Hint: 2 40 | You can work with multidimensional arrays by `Array[Index][SubIndex]` 41 | 42 | ## Hint: 3 43 | Pay close attention to the timing of the storing of variables when working with loops 44 | 45 | ## My code: 46 | 47 | ```js 48 | function largestOfFour(arr) { 49 | var results = []; 50 | for (var n in arr) { 51 | var largestNumber = 0; 52 | for (var sb in arr[n]) { 53 | if (arr[n][sb] > largestNumber) { 54 | largestNumber = arr[n][sb]; 55 | } 56 | } 57 | results[n] = largestNumber; 58 | } 59 | return results; 60 | } 61 | ``` 62 | 63 | ## My Code Explanation: 64 | - Create a variable to store the results as an array. 65 | - Create an outer loop to iterate through the main array. 66 | - Before going into the inner loop, create a variable to hold the largest number. This must be outside the inner loop. 67 | - Create another for loop to work with the sub-arrays. 68 | - Check if the element of the sub array is larger than the current largest number. If so, then save the number. 69 | - After the inner loop, save the largest number in the variable for the results. 70 | 71 | ## [Go Home](https://github.com/Rafase282/My-FreeCodeCamp-Code/wiki) 72 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/Express/Express-App-Param-Pam-Pam.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # Express App: Param Pam Pam 10 | 11 | This exercise is about using URL parameters. For example, if you have /message/526aa677a8ceb64569c9d4fb, then you should know how to extract that value which is an ID of the message. 12 | 13 | Create an Express.js server that processes PUT /message/:id requests and produces a SHA-1 hash of the current date combined with the ID from the URL. 14 | 15 | For instance, if the server receives 16 | 17 | ``` 18 | PUT /message/526aa677a8ceb64569c9d4fb 19 | ``` 20 | 21 | it will respond with a hash of the current date (as a string) and the ID. 22 | 23 | The SHA-1 can be computed like this: 24 | 25 | ```javascript 26 | require('crypto') 27 | .createHash('sha1') 28 | .update(new Date().toDateString() + id) 29 | .digest('hex') 30 | ``` 31 | 32 | ## HINTS 33 | 34 | Express.js apps can also be mounted to paths that contain a variable by prepending a : to the beginning of a variable name. For instance, in the following, app handles PUT requests in any subdirectory of /path/: 35 | 36 | ```javascript 37 | app.put('/path/:NAME', function(req, res){ /* ... */ }); 38 | ``` 39 | 40 | The given variable is then stored in req.params. So, to extract parameters from within the request handlers, use: 41 | 42 | ```javascript 43 | req.params.NAME 44 | ``` 45 | 46 | ## BONUS 47 | 48 | You can use req.param middleware to parse the URL parameter. 49 | 50 | For example, 51 | 52 | ```javascript 53 | app.param('id', function (req, res, next, id) { 54 | req.id = id 55 | ... 56 | next() 57 | }) 58 | 59 | app.get('/message/:id', function (req, res, next) { 60 | console.log(req.id) 61 | next() 62 | }) 63 | ``` 64 | 65 | ## My Solution 66 | 67 | ```javascript 68 | var express = require('express'); 69 | var app = express(); 70 | 71 | app.put('/message/:NAME', function(req, res) { 72 | var id = req.params.NAME; 73 | res.send(require('crypto') 74 | .createHash('sha1') 75 | .update(new Date().toDateString() + id) 76 | .digest('hex') 77 | ); 78 | }); 79 | 80 | app.listen(process.argv[2]); 81 | ``` 82 | 83 | ## Official Solution: 84 | 85 | ```javascript 86 | var express = require('express') 87 | var app = express() 88 | 89 | app.put('/message/:id', function(req, res) { 90 | var id = req.params.id 91 | var str = require('crypto') 92 | .createHash('sha1') 93 | .update(new Date().toDateString() + id) 94 | .digest('hex') 95 | res.send(str) 96 | }) 97 | 98 | app.listen(process.argv[2]) 99 | ``` 100 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/MongoDB/MongoDB-Update.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # MongoDB Update 10 | 11 | Here we are going to update a document in the users collection. 12 | 13 | The database name will be accessible via `process.argv[2]`. 14 | 15 | Say we have a user defined like: 16 | 17 | ```javascript 18 | { 19 | "name": "Tina", 20 | "age": 30, 21 | "username": "tinatime" 22 | } 23 | ``` 24 | 25 | We want to change Tina's age from 30 to 40. 26 | 27 | For the purpose of this lesson, assume that the username property is unique. 28 | 29 | ## HINTS 30 | 31 | To update a document, one would need to call `update()` on the collection. 32 | 33 | Ex. 34 | 35 | ```javascript 36 | // document 37 | // { a: 2, b: 3 } 38 | 39 | collection.update({ 40 | a: 2 41 | }, { 42 | $set: { 43 | b: 1 44 | } 45 | }, callback) 46 | 47 | // document was updated 48 | // { a: 2, b: 1 } 49 | ``` 50 | 51 | The first argument to update() is the query. This query is what filters the documents that we are wanting to update. The second argument is an object of the properties to update. Pay close attention to the $set property. If we were to omit $set, the document would be replaced with the object represented by the second argument. 52 | 53 | If your program does not finish executing, you may have forgotten to close the db. That can be done by calling `db.close()` after you have finished. 54 | 55 | ## Resources 56 | 57 | - 58 | - 59 | 60 | ## My Solution 61 | 62 | ```javascript 63 | var url = 'mongodb://localhost:27017/' + process.argv[2]; 64 | var MongoClient = require('mongodb').MongoClient; 65 | 66 | MongoClient.connect(url, function(err, db) { 67 | if (err) throw err; 68 | var collection = db.collection('users'); 69 | collection.update({ 70 | "username": "tinatime" 71 | }, { 72 | $set: { 73 | "age": 40 74 | } 75 | }, function() { 76 | // Callback, close connection 77 | db.close(); 78 | }) 79 | }) 80 | ``` 81 | 82 | ## Official Solution: 83 | 84 | ```javascript 85 | var mongo = require('mongodb').MongoClient 86 | 87 | var url = 'mongodb://localhost:27017/' + process.argv[2] 88 | mongo.connect(url, function(err, db) { 89 | if (err) throw err 90 | var collection = db.collection('users') 91 | collection.update({ 92 | username: 'tinatime' 93 | }, { 94 | $set: { 95 | age: 40 96 | } 97 | }, function(err) { 98 | if (err) throw err 99 | db.close() 100 | }) 101 | }) 102 | ``` 103 | -------------------------------------------------------------------------------- /Back-End-Development-Certification/MongoDB/MongoDB-Aggregate.md: -------------------------------------------------------------------------------- 1 | ### Author 2 | 3 | ![@Rafase282](https://avatars0.githubusercontent.com/Rafase282?&s=128) 4 | 5 | Created by Rafase282 6 | 7 | [Github](https://github.com/Rafase282) | [FreeCodeCamp](http://www.freecodecamp.com/rafase282) | [CodePen](http://codepen.io/Rafase282/) | [LinkedIn](https://www.linkedin.com/in/rafase282) | [Medium](https://medium.com/@Rafase282) [Website](https://rafase282.github.io/) | [E-Mail](mailto:rafase282@gmail.com) 8 | 9 | # MongoDB Aggregate 10 | 11 | Next up is aggregation. Aggregation allows one to do things like calculate the sum of a field of multiple documents or the average of a field of documents meeting particular criteria. 12 | 13 | Say you have a collection named prices. Each price document is modeled like so: 14 | 15 | ```javascript 16 | { 17 | "name": "Tshirt", 18 | "size": "S", 19 | "price": 10, 20 | "quantity": 12 21 | "meta": { 22 | "vendor": "hanes", 23 | "location": "US" 24 | } 25 | } 26 | ``` 27 | 28 | In this exercise, we need to calculate the average price for all documents in prices that have the **size** that will be passed as the first argument to your script. 29 | 30 | Use `console.log()` to print the average price rounded to 2 decimal places to stdout after you have found it. 31 | 32 | ## HINTS 33 | 34 | To use the `aggregate()` function, one first needs the collection. The `aggregate()` function takes an array of objects as the first argument. 35 | 36 | This array will contain the different pipelines for the aggregation. To read more about pipelines, please visit [Aggregation](http://docs.mongodb.org/manual/core/aggregation-introduction/). 37 | 38 | The two main pipeline stages we will use will be $match and $group. 39 | 40 | ### $match 41 | 42 | $match is used similar to the way a query is done. It allows us to select the documents that meet certain criteria. 43 | 44 | Ex. 45 | 46 | ```javascript 47 | var match = { $match: { status: 'A' } } 48 | ``` 49 | 50 | The above example will match all of the documents that have a status property equal to A. 51 | 52 | ### $group 53 | 54 | $group is what allows us to run operations on certain properties. 55 | 56 | So, say we wanted to get the sum of the values of the property value where status is equal to A and have it placed in the total property. 57 | 58 | Ex. 59 | 60 | ```javascript 61 | // [ 62 | // { status: 'A', value: 1 }, 63 | // { status: 'B', value: 2 }, 64 | // { status: 'A', value: 10 } 65 | // ] 66 | 67 | collection.aggregate([ 68 | { $match: { status: 'A' }} 69 | , { $group: { 70 | _id: 'total' // This can be an arbitrary string in this case 71 | , total: { 72 | // $sum is the operator used here 73 | $sum: '$value' 74 | } 75 | }} 76 | ]).toArray(function(err, results) { 77 | // handle error 78 | console.log(results) 79 | // => [ 80 | // => { _id: 'total', total: 11 } 81 | // => ] 82 | }) 83 | ``` 84 | 85 | Other operators used in the $group stage include: 86 | 87 | - `$avg` 88 | - `$first` 89 | - `$last` 90 | - `$max` 91 | - `$min` 92 | - `$push` 93 | - `$addToSet` 94 | --------------------------------------------------------------------------------