Javascript -> JavaScript (English) (#35183)

* Javascript -> JavaScript (English)

* Update technical documentation page for required change

* Update use-class-syntax-to-define-a-constructor-function.english.md

* Update left-factorials.md
This commit is contained in:
Lipis
2019-03-28 09:35:41 +01:00
committed by The Coding Aviator
parent fed6ffb606
commit e84ae45008
95 changed files with 192 additions and 192 deletions

View File

@ -13,7 +13,7 @@ You can use HTML, JavaScript, and CSS to complete this project. Plain CSS is rec
<strong>User Story #1:</strong> I can see a <code>main</code> element with a corresponding <code>id="main-doc"</code>, which contains the page's main content (technical documentation). <strong>User Story #1:</strong> I can see a <code>main</code> element with a corresponding <code>id="main-doc"</code>, which contains the page's main content (technical documentation).
<strong>User Story #2:</strong> Within the <code>#main-doc</code> element, I can see several <code>section</code> elements, each with a class of <code>main-section</code>. There should be a minimum of 5. <strong>User Story #2:</strong> Within the <code>#main-doc</code> element, I can see several <code>section</code> elements, each with a class of <code>main-section</code>. There should be a minimum of 5.
<strong>User Story #3:</strong> The first element within each <code>.main-section</code> should be a <code>header</code> element which contains text that describes the topic of that section. <strong>User Story #3:</strong> The first element within each <code>.main-section</code> should be a <code>header</code> element which contains text that describes the topic of that section.
<strong>User Story #4:</strong> Each <code>section</code> element with the class of <code>main-section</code> should also have an id that corresponds with the text of each <code>header</code> contained within it. Any spaces should be replaced with underscores (e.g. The <code>section</code> that contains the header "Javascript and Java" should have a corresponding <code>id="Javascript_and_Java"</code>). <strong>User Story #4:</strong> Each <code>section</code> element with the class of <code>main-section</code> should also have an id that corresponds with the text of each <code>header</code> contained within it. Any spaces should be replaced with underscores (e.g. The <code>section</code> that contains the header "JavaScript and Java" should have a corresponding <code>id="JavaScript_and_Java"</code>).
<strong>User Story #5:</strong> The <code>.main-section</code> elements should contain at least 10 <code>p</code> elements total (not each). <strong>User Story #5:</strong> The <code>.main-section</code> elements should contain at least 10 <code>p</code> elements total (not each).
<strong>User Story #6:</strong> The <code>.main-section</code> elements should contain at least 5 <code>code</code> elements total (not each). <strong>User Story #6:</strong> The <code>.main-section</code> elements should contain at least 5 <code>code</code> elements total (not each).
<strong>User Story #7:</strong> The <code>.main-section</code> elements should contain at least 5 <code>li</code> items total (not each). <strong>User Story #7:</strong> The <code>.main-section</code> elements should contain at least 5 <code>li</code> items total (not each).

View File

@ -15,7 +15,7 @@ The class syntax simply replaces the constructor function creation:
Notice that the <code>class</code> keyword declares a new function, and a constructor was added, which would be invoked when <code>new</code> is called - to create a new object.<br> Notice that the <code>class</code> keyword declares a new function, and a constructor was added, which would be invoked when <code>new</code> is called - to create a new object.<br>
<strong>Notes:</strong><br><ul> <strong>Notes:</strong><br><ul>
<li> UpperCamelCase should be used by convention for ES6 class names, as in <code>SpaceShuttle</code> used above.</li> <li> UpperCamelCase should be used by convention for ES6 class names, as in <code>SpaceShuttle</code> used above.</li>
<li> The constructor method is a special method for creating and initializing an object created with a class. You will learn more about it in the Object Oriented Programming section of the Javascript Algorithms And Data Structures Certification.</li></ul> <li> The constructor method is a special method for creating and initializing an object created with a class. You will learn more about it in the Object Oriented Programming section of the JavaScript Algorithms And Data Structures Certification.</li></ul>
</section> </section>
## Instructions ## Instructions

View File

@ -73,7 +73,7 @@ function leftFactorial(n) {
return 1; return 1;
// Note: for n>=20, the result may not be correct. // Note: for n>=20, the result may not be correct.
// This is because Javascript uses 53 bit integers and // This is because JavaScript uses 53 bit integers and
// for n>=20 result becomes too large. // for n>=20 result becomes too large.
let res = 2, fact = 2; let res = 2, fact = 2;
@ -86,4 +86,4 @@ function leftFactorial(n) {
} }
``` ```
</section> </section>

View File

@ -119,7 +119,7 @@ Acceptance testing can also validate if a completed epic/story/task fulfills the
- FitNesse, a fork of Fit - FitNesse, a fork of Fit
- iMacros - iMacros
- ItsNat Java Ajax web framework with built-in, server based, functional web testing capabilities. - ItsNat Java Ajax web framework with built-in, server based, functional web testing capabilities.
- Mocha, a popular web acceptance test framework based on Javascript and Node.js - Mocha, a popular web acceptance test framework based on JavaScript and Node.js
- Ranorex - Ranorex
- Robot Framework - Robot Framework
- Selenium - Selenium

View File

@ -42,7 +42,7 @@ Step 4: **Repeat Steps 2 and 3 until `a mod b` is greater than 0**
Step 5: **GCD = b** Step 5: **GCD = b**
Step 6: Finish Step 6: Finish
Javascript Code to Perform GCD- JavaScript Code to Perform GCD-
```javascript ```javascript
function gcd(a, b) { function gcd(a, b) {
var R; var R;
@ -55,7 +55,7 @@ function gcd(a, b) {
} }
``` ```
Javascript Code to Perform GCD using Recursion- JavaScript Code to Perform GCD using Recursion-
```javascript ```javascript
function gcd(a, b) { function gcd(a, b) {
if (b == 0) if (b == 0)

View File

@ -92,7 +92,7 @@ Binary Search Trees are very powerful because of their O(log n) search times, se
The code for recursive binary search is shown below: The code for recursive binary search is shown below:
### Javascript implementation ### JavaScript implementation
```javascript ```javascript
function binarySearch(arr, item, low, high) { function binarySearch(arr, item, low, high) {
@ -120,9 +120,9 @@ var numbers = [1,2,3,4,5,6,7];
print(binarySearch(numbers, 5, 0, numbers.length-1)); print(binarySearch(numbers, 5, 0, numbers.length-1));
``` ```
Here is another implementation in Javascript: Here is another implementation in JavaScript:
```Javascript ```JavaScript
function binary_search(a, v) { function binary_search(a, v) {
function search(low, high) { function search(low, high) {
if (low === high) { if (low === high) {

View File

@ -55,7 +55,7 @@ int linearSearch(int arr[], int num)
``` ```
### Example in Javascript ### Example in JavaScript
```javascript ```javascript
function linearSearch(arr, item) { function linearSearch(arr, item) {
// Go through all the elements of arr to look for item. // Go through all the elements of arr to look for item.

View File

@ -96,7 +96,7 @@ The algorithm shown below is a slightly optimized version to avoid swapping the
arr[i+1] = key arr[i+1] = key
``` ```
Here is a detailed implementation in Javascript: Here is a detailed implementation in JavaScript:
``` ```
function insertion_sort(A) { function insertion_sort(A) {

View File

@ -66,8 +66,8 @@ void recurSelectionSort(int a[], int n, int index = 0)
} }
``` ```
### Implementation in Javascript ### Implementation in JavaScript
``` Javascript ```js
function selection_sort(A) { function selection_sort(A) {
var len = A.length; var len = A.length;
for (var i = 0; i < len - 1; i = i + 1) { for (var i = 0; i < len - 1; i = i + 1) {

View File

@ -153,7 +153,7 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { AppService } from './app.service'; import { AppService } from './app.service';
// Javascript module system is strict about where it imports. It can only import at the top of files. // JavaScript module system is strict about where it imports. It can only import at the top of files.
// Angular NgModule uses those tokens in its metadata settings // Angular NgModule uses those tokens in its metadata settings
@NgModule({ // import { NgModule } from '@angular/core'; @NgModule({ // import { NgModule } from '@angular/core';

View File

@ -3,7 +3,7 @@ title: Canvas
--- ---
## HTML5 Canvas ## HTML5 Canvas
Canvas is a technology introduced in HTML5 which can be accessed by the `<canvas>` tag. It allows graphics to be drawn via Javascript, and is a powerful tool for interactivity on all modern web browsers. Learn how to draw shapes, manipulate photos, build games, and animate virtually anything following the links below! Canvas is a technology introduced in HTML5 which can be accessed by the `<canvas>` tag. It allows graphics to be drawn via JavaScript, and is a powerful tool for interactivity on all modern web browsers. Learn how to draw shapes, manipulate photos, build games, and animate virtually anything following the links below!
## Usage ## Usage

View File

@ -7,7 +7,7 @@ title: Learn how a Stack Works
- Stacks are an abstract data structures. - Stacks are an abstract data structures.
- They follow LIFO (Last In First Out) or FILO (First In Last Out) principle. - They follow LIFO (Last In First Out) or FILO (First In Last Out) principle.
- Stack's insertion and deletion operations are of **O(1)** time complexity. - Stack's insertion and deletion operations are of **O(1)** time complexity.
- In Javascript, arrays can be treated as a Stack since `.push()` and `.pop()` methods have time complexity of **O(1)**. - In JavaScript, arrays can be treated as a Stack since `.push()` and `.pop()` methods have time complexity of **O(1)**.
- In this challenge we need to `.pop()` and then `.push()` into the stack. - In this challenge we need to `.pop()` and then `.push()` into the stack.
### Solution: ### Solution:

View File

@ -2,7 +2,7 @@
title: Add Comments in JSX title: Add Comments in JSX
--- ---
## Add Comments in JSX ## Add Comments in JSX
You can comment as you used to do with code blocks in Javascript `/* some JS code */` but they need to wrapped by curly braces to add comments in JSX: You can comment as you used to do with code blocks in JavaScript `/* some JS code */` but they need to wrapped by curly braces to add comments in JSX:
For example: For example:
* Single-line comment: * Single-line comment:
```jsx ```jsx

View File

@ -26,4 +26,4 @@ class MyComponent extends React.Component {
}; };
``` ```
Note that you don't need to put quotes around the text, because when you are working with JSX it is treated as HTML. Also check to make sure your spelling, case, and punctuation are correct! If all this code looks strange, go check out some of the great material on Javascript ES6 here on freeCodeCamp. Note that you don't need to put quotes around the text, because when you are working with JSX it is treated as HTML. Also check to make sure your spelling, case, and punctuation are correct! If all this code looks strange, go check out some of the great material on JavaScript ES6 here on freeCodeCamp.

View File

@ -36,7 +36,7 @@ testEqual(10);
The function first evaluates `if` the condition `(val == 12)` evaluates to `true`. If it does, it returns the statement between the curly braces ("Equal"). If it doesn't, it returns the next `return` statement outside them ("Not equal"). The function first evaluates `if` the condition `(val == 12)` evaluates to `true`. If it does, it returns the statement between the curly braces ("Equal"). If it doesn't, it returns the next `return` statement outside them ("Not equal").
### Sources ### Sources
<span id="cite1">1</span>. ["Basic JavaScript: Comparison with the Equality Operator", fCC lesson at *Javascript Algorithms And Data Structures Certification*](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator) <span id="cite1">1</span>. ["Basic JavaScript: Comparison with the Equality Operator", fCC lesson at *JavaScript Algorithms And Data Structures Certification*](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator)
### Resources ### Resources

View File

@ -40,9 +40,9 @@ testStrict(10);
The function first evaluates `if` the condition `(val === 7)` evaluates to `true`. If it does, it returns the statement between the curly braces ("Equal"). If it doesn't, it returns the next `return` statement outside them ("Not equal"). The function first evaluates `if` the condition `(val === 7)` evaluates to `true`. If it does, it returns the statement between the curly braces ("Equal"). If it doesn't, it returns the next `return` statement outside them ("Not equal").
### Sources ### Sources
<span id="cite1">1</span>. ["Basic JavaScript: Comparison with the Equality Operator", fCC lesson at *Javascript Algorithms And Data Structures Certification*](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator) <span id="cite1">1</span>. ["Basic JavaScript: Comparison with the Equality Operator", fCC lesson at *JavaScript Algorithms And Data Structures Certification*](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator)
<span id="cite2">2</span>. ["Basic JavaScript: Comparison with the Strict Equality Operator", fCC lesson at *Javascript Algorithms And Data Structures Certification*](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator) <span id="cite2">2</span>. ["Basic JavaScript: Comparison with the Strict Equality Operator", fCC lesson at *JavaScript Algorithms And Data Structures Certification*](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator)
### Resources ### Resources

View File

@ -131,4 +131,4 @@ function cc(card) {
* <a href='https://en.wikipedia.org/wiki/Card_counting' target='_blank' rel='nofollow'>Card counting at Wikipedia</a> * <a href='https://en.wikipedia.org/wiki/Card_counting' target='_blank' rel='nofollow'>Card counting at Wikipedia</a>
* <a href='http://www.freecodecamp.com/challenges/selecting-from-many-options-with-switch-statements' target='_blank' rel='nofollow'>Challenge: Selecting from many options with Switch Statements</a> * <a href='http://www.freecodecamp.com/challenges/selecting-from-many-options-with-switch-statements' target='_blank' rel='nofollow'>Challenge: Selecting from many options with Switch Statements</a>
* <a href='http://www.freecodecamp.com/challenges/chaining-if-else-statements' target='_blank' rel='nofollow'>Challenge: Chaining If Else Statements</a> * <a href='http://www.freecodecamp.com/challenges/chaining-if-else-statements' target='_blank' rel='nofollow'>Challenge: Chaining If Else Statements</a>
* <a href='http://www.freecodecamp.com/challenges/increment-a-number-with-javascript' target='_blank' rel='nofollow'>Challenge: Increment a Number with Javascript</a> * <a href='http://www.freecodecamp.com/challenges/increment-a-number-with-javascript' target='_blank' rel='nofollow'>Challenge: Increment a Number with JavaScript</a>

View File

@ -3,7 +3,7 @@ title: Divide One Decimal by Another with JavaScript
--- ---
# Divide One Decimal by Another with JavaScript # Divide One Decimal by Another with JavaScript
Javascript uses the `/` symbol for division. JavaScript uses the `/` symbol for division.
var quotient = 0.6 / 0.3; //quotient gets the value 2 var quotient = 0.6 / 0.3; //quotient gets the value 2

View File

@ -3,7 +3,7 @@ title: Divide One Number by Another with JavaScript
--- ---
# Divide One Number by Another with JavaScript # Divide One Number by Another with JavaScript
Javascript uses the `/` symbol for division. JavaScript uses the `/` symbol for division.
var quotient = 6 / 3; //quotient will get value 2 var quotient = 6 / 3; //quotient will get value 2

View File

@ -1,7 +1,7 @@
--- ---
title: Basic Javascript title: Basic JavaScript
--- ---
## Basic Javascript ## Basic JavaScript
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/quadratic-equations/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>. This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/quadratic-equations/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.

View File

@ -89,4 +89,4 @@ sequentialSizes(1);
Since you already have a variable named `answer` defined and the function returns it, you can just modify its value on each group of case statements to fit the exercise requirements. Since you already have a variable named `answer` defined and the function returns it, you can just modify its value on each group of case statements to fit the exercise requirements.
### Resources ### Resources
- ["Switch: Methods for multi-criteria case" - *MDN Javascript Reference*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch) - ["Switch: Methods for multi-criteria case" - *MDN JavaScript Reference*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch)

View File

@ -36,7 +36,7 @@ The function first evaluates `if` the condition `(a === b)` evaluates to `true`
### Sources ### Sources
<span id="cite1">1</span>. ["Basic JavaScript: Comparison with the Strict Equality Operator", fCC lesson at *Javascript Algorithms And Data Structures Certification*](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator) <span id="cite1">1</span>. ["Basic JavaScript: Comparison with the Strict Equality Operator", fCC lesson at *JavaScript Algorithms And Data Structures Certification*](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator)
### Resources ### Resources

View File

@ -41,4 +41,4 @@ isLess(10, 15);
Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-Js-Returning-boolean-from-function). Run code at [repl.it](https://repl.it/@AdrianSkar/Basic-Js-Returning-boolean-from-function).
### Resources ### Resources
- ["Less than or equal operator (<=)" - *MDN Javascript Reference*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Less_than_or_equal_operator_(%3C)) - ["Less than or equal operator (<=)" - *MDN JavaScript Reference*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Less_than_or_equal_operator_(%3C))

View File

@ -7,11 +7,11 @@ title: Understanding the Differences between the freeCodeCamp and Browser Consol
So were exactly do you run this *console.log()* command? So were exactly do you run this *console.log()* command?
In order to see the difference between the live console (terminal of freecodecamp) and our browser console we need to open up the console in our browser. In order to see the difference between the live console (terminal of freecodecamp) and our browser console we need to open up the console in our browser.
Contemporary internet browser have a built in feature called Developer Tools which, among others contains a live console. Contemporary internet browser have a built in feature called Developer Tools which, among others contains a live console.
In this console we can execute Javascript commands and see the result. It behaves in a same manner as the window we write code here in Freecodecamp! In this console we can execute JavaScript commands and see the result. It behaves in a same manner as the window we write code here in Freecodecamp!
***Please follow the instructions provided and copy paste the JS code provided to the example from FCC to your browser's console!*** ***Please follow the instructions provided and copy paste the JS code provided to the example from FCC to your browser's console!***
Depending on your browser, in order to open up the Javascript console you need to: Depending on your browser, in order to open up the JavaScript console you need to:
## Chrome: ## Chrome:
* Click the the following: Menu->More Tools->Developer Tools->Console tab * Click the the following: Menu->More Tools->Developer Tools->Console tab

View File

@ -57,7 +57,7 @@ console.log(increment(5)); // returns NaN
Relevant Links: Relevant Links:
[Javascript default parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters) [JavaScript default parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters)
# :clipboard: NOTES FOR CONTRIBUTIONS: # :clipboard: NOTES FOR CONTRIBUTIONS:

View File

@ -29,5 +29,5 @@ var new_s = s.myMap(function(item){
``` ```
### Useful Links ### Useful Links
[this. Javascript MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this)<br/> [this. JavaScript MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this)<br/>
[this. Javascript W3Schools](https://www.w3schools.com/js/js_this.asp) [this. JavaScript W3Schools](https://www.w3schools.com/js/js_this.asp)

View File

@ -1,7 +1,7 @@
--- ---
title: Javascript Algorithms and Data Structures title: JavaScript Algorithms and Data Structures
--- ---
## Javascript Algorithms and Data Structures ## JavaScript Algorithms and Data Structures
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/quadratic-equations/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>. This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/quadratic-equations/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.

View File

@ -3,7 +3,7 @@ title: Intermediate Algorithm Scripting
--- ---
## Intermediate Algorithm Scripting ## Intermediate Algorithm Scripting
This section contains intermediate level coding problems that will test your ability to solve complex problems similar to those that you may see in real situations using Javascript. All the best! This section contains intermediate level coding problems that will test your ability to solve complex problems similar to those that you may see in real situations using JavaScript. All the best!
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds --> <!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information: #### More Information:

View File

@ -1,7 +1,7 @@
--- ---
title: Javascript Algorithms and Data Structures Projects title: JavaScript Algorithms and Data Structures Projects
--- ---
## Javascript Algorithms and Data Structures Projects ## JavaScript Algorithms and Data Structures Projects
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/quadratic-equations/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>. This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/quadratic-equations/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.

View File

@ -86,7 +86,7 @@ The first expression gets evaluated if it's false, and the second gets evaluated
**Note:** There is no `when/else`. `when` _only_ executes if the condition is true. **Note:** There is no `when/else`. `when` _only_ executes if the condition is true.
`cond` allows you to combine many conditions into a single expression. It takes a sequence of logical expression and expression pairs and evaluate each logical expression in order. When it finds a logical expression that evaluates to `true`, it evaluates the second expression of the pair. After this, no other expressions are evaluated. This behavior is like short-circuit logic in Javascript. `cond` allows you to combine many conditions into a single expression. It takes a sequence of logical expression and expression pairs and evaluate each logical expression in order. When it finds a logical expression that evaluates to `true`, it evaluates the second expression of the pair. After this, no other expressions are evaluated. This behavior is like short-circuit logic in JavaScript.
(cond (= 0 1) "I'm paired with a false expression and I don't evalute.." (cond (= 0 1) "I'm paired with a false expression and I don't evalute.."
(= 1 1) "I'm the first expression paired with a true expression!" (= 1 1) "I'm the first expression paired with a true expression!"

View File

@ -1,7 +1,7 @@
--- ---
title: Clojure Hashmaps title: Clojure Hashmaps
--- ---
A hashmap is a collection that maps keys to values. They have various names in other languages; Python refers to them as dictionaries, and Javascript's objects essentially work like hashmaps. A hashmap is a collection that maps keys to values. They have various names in other languages; Python refers to them as dictionaries, and JavaScript's objects essentially work like hashmaps.
A hashmap can, like many collections, be constructed in two ways. There is the constructor function: A hashmap can, like many collections, be constructed in two ways. There is the constructor function:
@ -92,4 +92,4 @@ A hashmap is useful when you want to give names to your variables. If you're eve
They are also useful if you want to associate two different values with each other. Take, for example, a ROT13 cipher: you could associate `\A` with `\N`, `\B` with `\M`, etc. (This would be long and boring to write in most languages, but Clojure has some functions that can generate it for you and make it _fun!_) They are also useful if you want to associate two different values with each other. Take, for example, a ROT13 cipher: you could associate `\A` with `\N`, `\B` with `\M`, etc. (This would be long and boring to write in most languages, but Clojure has some functions that can generate it for you and make it _fun!_)
| [![:point_left:](//forum.freecodecamp.com/images/emoji/emoji_one/point_left.png?v=2 ":point_left:") Previous](//forum.freecodecamp.com/t/clojure-vectors/18421) | [![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:") Home ![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:")](//forum.freecodecamp.com/t/clojure-resources/18422) | Next ![:point_right:](//forum.freecodecamp.com/images/emoji/emoji_one/point_right.png?v=2 ":point_right:") | | [![:point_left:](//forum.freecodecamp.com/images/emoji/emoji_one/point_left.png?v=2 ":point_left:") Previous](//forum.freecodecamp.com/t/clojure-vectors/18421) | [![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:") Home ![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:")](//forum.freecodecamp.com/t/clojure-resources/18422) | Next ![:point_right:](//forum.freecodecamp.com/images/emoji/emoji_one/point_right.png?v=2 ":point_right:") |
| [Vectors](//forum.freecodecamp.com/t/clojure-vectors/18421) | [Table of Contents](//forum.freecodecamp.com/t/clojure-resources/18422) | To Be Added | | [Vectors](//forum.freecodecamp.com/t/clojure-vectors/18421) | [Table of Contents](//forum.freecodecamp.com/t/clojure-resources/18422) | To Be Added |

View File

@ -1,7 +1,7 @@
--- ---
title: Clojure Vectors title: Clojure Vectors
--- ---
A vector is perhaps the most simple type of collection in Clojure. You can think of it like an array in Javascript. Let's define a simple vector: A vector is perhaps the most simple type of collection in Clojure. You can think of it like an array in JavaScript. Let's define a simple vector:
(def a-vector [1 2 3 4 5]) (def a-vector [1 2 3 4 5])
;; Alternatively, use the vector function: ;; Alternatively, use the vector function:
@ -60,4 +60,4 @@ Non-vector data structures can be converted into vectors using the `vec` functio
A vector should be used in almost all cases if you need a collection, because they have the shortest random-access times, which makes it easy to retrieve items from a vector. Note that vectors are ordered. If order doesn't matter, it may be better to use a set. Also note that vectors are designed for appending items; if you need to prepend items, you might want to use a list. A vector should be used in almost all cases if you need a collection, because they have the shortest random-access times, which makes it easy to retrieve items from a vector. Note that vectors are ordered. If order doesn't matter, it may be better to use a set. Also note that vectors are designed for appending items; if you need to prepend items, you might want to use a list.
| [![:point_left:](//forum.freecodecamp.com/images/emoji/emoji_one/point_left.png?v=2 ":point_left:") Previous](//forum.freecodecamp.com/t/clojure-lists-they-are-everything/18417) | [![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:") Home ![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:")](//forum.freecodecamp.com/t/clojure-resources/18422) | [Next ![:point_right:](//forum.freecodecamp.com/images/emoji/emoji_one/point_right.png?v=2 ":point_right:")](//forum.freecodecamp.com/t/clojure-hashmaps/18414)| | [![:point_left:](//forum.freecodecamp.com/images/emoji/emoji_one/point_left.png?v=2 ":point_left:") Previous](//forum.freecodecamp.com/t/clojure-lists-they-are-everything/18417) | [![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:") Home ![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:")](//forum.freecodecamp.com/t/clojure-resources/18422) | [Next ![:point_right:](//forum.freecodecamp.com/images/emoji/emoji_one/point_right.png?v=2 ":point_right:")](//forum.freecodecamp.com/t/clojure-hashmaps/18414)|
| [Lists](//forum.freecodecamp.com/t/clojure-lists-they-are-everything/18417) | [Table of Contents](//forum.freecodecamp.com/t/clojure-resources/18422) | [Hashmaps](//forum.freecodecamp.com/t/clojure-hashmaps/18414)| | [Lists](//forum.freecodecamp.com/t/clojure-lists-they-are-everything/18417) | [Table of Contents](//forum.freecodecamp.com/t/clojure-resources/18422) | [Hashmaps](//forum.freecodecamp.com/t/clojure-hashmaps/18414)|

View File

@ -14,7 +14,7 @@ ADD 10, 20 // ADD is the Opcode
// and 10, 20 are the two operands(data) // and 10, 20 are the two operands(data)
// needed for the ADD instruction to be executed successfully // needed for the ADD instruction to be executed successfully
``` ```
Humans develop programs to solve complex problems. Looking at how simple opcodes are, if we try to develop programs using opcodes alone, it will be very cumbersome and difficult to debug. To solve this problem, high level languages like C/C++, Python, Java, Javascript, etc were developed. Humans develop programs to solve complex problems. Looking at how simple opcodes are, if we try to develop programs using opcodes alone, it will be very cumbersome and difficult to debug. To solve this problem, high level languages like C/C++, Python, Java, JavaScript, etc were developed.
Now, high level languages aren't suitable for execution by computers. Hence, the need arose for a translator that can digest the high-level language programs and convert them to machine language instructions suitable for execution by a computer. Now, high level languages aren't suitable for execution by computers. Hence, the need arose for a translator that can digest the high-level language programs and convert them to machine language instructions suitable for execution by a computer.

View File

@ -13,7 +13,7 @@ A linked list is a simple data structure, but it can be used to implement more c
Linked List | (Introduction) Linked List | (Introduction)
Like arrays, Linked List is a linear data structure. Unlike arrays, linked list elements are not stored at contiguous location; the elements are linked using pointers or like in the example using Javascript, a reference to the next node. Like arrays, Linked List is a linear data structure. Unlike arrays, linked list elements are not stored at contiguous location; the elements are linked using pointers or like in the example using JavaScript, a reference to the next node.
If you want to understand Linked Lists, it helps to understand **Arrays**. If you want to understand Linked Lists, it helps to understand **Arrays**.
@ -320,7 +320,7 @@ Types:
2) (Doubly) In a 'doubly linked list', each node contains, besides the next-node link, a second link field pointing to the 'previous' node in the sequence. The two links may be called 'forward('s') and 'backwards', or 'next' and 'prev'('previous'). 2) (Doubly) In a 'doubly linked list', each node contains, besides the next-node link, a second link field pointing to the 'previous' node in the sequence. The two links may be called 'forward('s') and 'backwards', or 'next' and 'prev'('previous').
Example in Javascript: Example in JavaScript:
``` ```
function LinkedList () { function LinkedList () {
this.head = null; this.head = null;

View File

@ -4,7 +4,7 @@ title: Async / Await
# Async / Await Keywords # Async / Await Keywords
The `async`/`await` keywords in C# provide convenient ways of managing resource-intensive applications, which are more common in front-end languages such as Javascript libraries. Methods that return `Task<T>` types can be crowned with the `async` keyword, and when calling these methods in a UI handler or service workflow, we can use the `await` on the methods to tell C# to yield the control back to its caller until the background job is finished. By yielding the control on resources-intensive calls, we are able to allow UI to be more responsive and make the service more elastic. The `async`/`await` keywords in C# provide convenient ways of managing resource-intensive applications, which are more common in front-end languages such as JavaScript libraries. Methods that return `Task<T>` types can be crowned with the `async` keyword, and when calling these methods in a UI handler or service workflow, we can use the `await` on the methods to tell C# to yield the control back to its caller until the background job is finished. By yielding the control on resources-intensive calls, we are able to allow UI to be more responsive and make the service more elastic.
The core of the `async` and `await` are the `Task<T>` class. When using it along with the `async` keyword as the return type of a method, we indicate that the method has promised to return an object of the `T` type (for methods that wouldn't return any value, use `Task` as the return type instead). `Task<T>` is a sophisticated topic of its own, for more information, please refer to the official documents: [Task Class](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task?view=netframework-4.7.1). The core of the `async` and `await` are the `Task<T>` class. When using it along with the `async` keyword as the return type of a method, we indicate that the method has promised to return an object of the `T` type (for methods that wouldn't return any value, use `Task` as the return type instead). `Task<T>` is a sophisticated topic of its own, for more information, please refer to the official documents: [Task Class](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task?view=netframework-4.7.1).

View File

@ -7,7 +7,7 @@ Bootstrap is the most popular CSS framework for developing responsive, mobile fi
## Getting Started - Latest version: 4.1 ## Getting Started - Latest version: 4.1
Below is a simple HTML template which includes the latest compiled and minified CSS and Javascript for the Bootstrap library. We have used a CDN in this example, please see <a href='https://getbootstrap.com/docs/4.1/getting-started/download/' target='_blank' rel='nofollow'>the official documentation</a> for other ways of installing the latest version of Bootstrap. Below is a simple HTML template which includes the latest compiled and minified CSS and JavaScript for the Bootstrap library. We have used a CDN in this example, please see <a href='https://getbootstrap.com/docs/4.1/getting-started/download/' target='_blank' rel='nofollow'>the official documentation</a> for other ways of installing the latest version of Bootstrap.
```html ```html
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -7,7 +7,7 @@ title: CSS Framework Foundation
## Getting Started ## Getting Started
Here is a simple HTML template which includes the latest compiled and minified CSS and Javascript for the Foundation library. Here is a simple HTML template which includes the latest compiled and minified CSS and JavaScript for the Foundation library.
```html ```html
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -7,7 +7,7 @@ Materialize is a Responsive CSS framework based on Google's <a href='https://des
## Getting Started ## Getting Started
Here is a simple HTML template which includes the latest compiled and minified CSS and Javascript for the Materialize library. Here is a simple HTML template which includes the latest compiled and minified CSS and JavaScript for the Materialize library.
```html ```html
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>

View File

@ -1,31 +1,31 @@
--- ---
title: CSS Framework Semantic UI title: CSS Framework Semantic UI
--- ---
# CSS Framework Semantic UI # CSS Framework Semantic UI
Semantic UI is one of the most popular CSS framework for developing responsive, mobile first projects for the web. Semantic UI is one of the most popular CSS framework for developing responsive, mobile first projects for the web.
## Getting Started ## Getting Started
Here is a simple HTML template which includes the latest compiled and minified CSS and Javascript for the Semantic UI library. We have used a CDN in this example, but you can checkout other ways of installing Semantic UI <a href='https://semantic-ui.com/introduction/getting-started.html' target='_blank' rel='nofollow'>here</a>. Here is a simple HTML template which includes the latest compiled and minified CSS and JavaScript for the Semantic UI library. We have used a CDN in this example, but you can checkout other ways of installing Semantic UI <a href='https://semantic-ui.com/introduction/getting-started.html' target='_blank' rel='nofollow'>here</a>.
```html ```html
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Semantic UI Template</title> <title>Semantic UI Template</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.13/semantic.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.13/semantic.min.css">
</head> </head>
<body> <body>
<h1>Hello World</h1> <h1>Hello World</h1>
<!-- Add all HTML Code here --> <!-- Add all HTML Code here -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.13/semantic.min.js"></script> <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.13/semantic.min.js"></script>
</body> </body>
</html> </html>
``` ```
## Learning Resources ## Learning Resources
* The official documentation for Semantic UI is available <a href='https://semantic-ui.com/introduction/getting-started.html' target='_blank' rel='nofollow'>here</a>. * The official documentation for Semantic UI is available <a href='https://semantic-ui.com/introduction/getting-started.html' target='_blank' rel='nofollow'>here</a>.
* Checkout Semantic UI's open source GitHub repository <a href='https://github.com/Semantic-Org/Semantic-UI' target='_blank' rel='nofollow'>here</a>. * Checkout Semantic UI's open source GitHub repository <a href='https://github.com/Semantic-Org/Semantic-UI' target='_blank' rel='nofollow'>here</a>.

View File

@ -19,7 +19,7 @@ CSS was first proposed way back in 1994 by Håkon Wium Lie, who was working with
Before CSS, developers would apply styles using attributes or special tags on each node of a page. This made markup repetitive and prone to errors. Before CSS, developers would apply styles using attributes or special tags on each node of a page. This made markup repetitive and prone to errors.
CSS allows selectors to describe how each piece of matching content should look. It is an important technology of World Wide Web, along with HTML and Javascript. CSS allows selectors to describe how each piece of matching content should look. It is an important technology of World Wide Web, along with HTML and JavaScript.
```CSS ```CSS
body { body {
font-size: 15px; font-size: 15px;

View File

@ -10,7 +10,7 @@ title: Functional Programming
### Why Functional Programming? ### Why Functional Programming?
Functional programming (sometimes abbreviated as FP) has had a resurgence among Javascript developers recently because of the focus on functional programming principles in popular libraries such as [Redux](https://redux.js.org/). Functional programming (sometimes abbreviated as FP) has had a resurgence among JavaScript developers recently because of the focus on functional programming principles in popular libraries such as [Redux](https://redux.js.org/).
Although functional programming can be intimidating for some beginning developers, knowing some of the basics can be very useful regardless of what libraries you use. Specifically thinking about times when to use declarative programming and pure functions—for example, to keep code clean, easy to read, easy to test, and easy to maintain—helps as you move towards larger projects where you might be working with multiple developers and want a good [code smell](https://guide.freecodecamp.org/agile/code-smells/). It's also something often asked about briefly in coding interviews, so even knowing a few basic principles can be very helpful. This article represents only the most bare-bones overview; more research is recommended. Although functional programming can be intimidating for some beginning developers, knowing some of the basics can be very useful regardless of what libraries you use. Specifically thinking about times when to use declarative programming and pure functions—for example, to keep code clean, easy to read, easy to test, and easy to maintain—helps as you move towards larger projects where you might be working with multiple developers and want a good [code smell](https://guide.freecodecamp.org/agile/code-smells/). It's also something often asked about briefly in coding interviews, so even knowing a few basic principles can be very helpful. This article represents only the most bare-bones overview; more research is recommended.

View File

@ -4,7 +4,7 @@ title: Chrome Developer Tools
## Chrome Firefox Development Tools ## Chrome Firefox Development Tools
Chrome and Firefox Developer tools assist web developers in analyzing the HTML, CSS and Javascript on a web page. They are useful for debugging, optimizing code, inspecting elements and much more. Chrome and Firefox Developer tools assist web developers in analyzing the HTML, CSS and JavaScript on a web page. They are useful for debugging, optimizing code, inspecting elements and much more.
**Features:** **Features:**
* **Page Inspector:** View and edit page content and layout. * **Page Inspector:** View and edit page content and layout.

View File

@ -3,7 +3,7 @@ title: Firefox Developer Tools
--- ---
## Firefox Developer Tools ## Firefox Developer Tools
Firefox Developer tools aid web developers with writing, analyzing, and debugging HTML, CSS and Javascript code. Firefox Developer tools aid web developers with writing, analyzing, and debugging HTML, CSS and JavaScript code.
Core Features: Core Features:

View File

@ -3,7 +3,7 @@ title: Elm
--- ---
## Elm ## Elm
[Elm](http://elm-lang.org/) is a domain-specific, purely functional programming language that compiles into Javascript. This programming language is statically typed, and was developed with an emphasis on usability, performance, and robustness. Elm was built by Evan Czaplicki in 2012, and was influenced by Haskell, Standard ML, and OCaml among others. It also helped to inspire the popular state management tool, Redux. [Elm](http://elm-lang.org/) is a domain-specific, purely functional programming language that compiles into JavaScript. This programming language is statically typed, and was developed with an emphasis on usability, performance, and robustness. Elm was built by Evan Czaplicki in 2012, and was influenced by Haskell, Standard ML, and OCaml among others. It also helped to inspire the popular state management tool, Redux.
### The Elm Architecture ### The Elm Architecture

View File

@ -12,7 +12,7 @@ Mesa 3D is an open-source implementation of OpenGL. It can do pure software rend
## Prerequisites ## Prerequisites
No special prerequisite is needed to follow most tutorials. Experience with any programming langage ( C, Java, Lisp, Javascript) is better to fully understand the code, but not needed; it will merely be more complicated to learn two things at the same time. No special prerequisite is needed to follow most tutorials. Experience with any programming langage ( C, Java, Lisp, JavaScript) is better to fully understand the code, but not needed; it will merely be more complicated to learn two things at the same time.
## Installing OpenGL on Linux ## Installing OpenGL on Linux
Mesa is the GL library used. Ubuntu 16.04 includes Mesa 11.2 which supports OpenGL 4.1. Just install the `libgl1-mesa-dev` and `mesa-common-dev` packages to install the development files for it. Mesa is the GL library used. Ubuntu 16.04 includes Mesa 11.2 which supports OpenGL 4.1. Just install the `libgl1-mesa-dev` and `mesa-common-dev` packages to install the development files for it.

View File

@ -52,7 +52,7 @@ var m = map[string]bool{
} }
m["Go"] // true m["Go"] // true
m["JavaScript"] = true // Set Javascript to true m["JavaScript"] = true // Set JavaScript to true
delete(m, "JavaScript") // Delete "JavaScript" key and value delete(m, "JavaScript") // Delete "JavaScript" key and value
language, ok = m["C++"] // ok is false, language is bool's zero-value (false) language, ok = m["C++"] // ok is false, language is bool's zero-value (false)
``` ```

View File

@ -5,7 +5,7 @@ title: Script Tag
The HTML Script tag is used to either contain client side JavaScript or reference an external JavaScript file using the script “src” attribute. The HTML Script tag is used to either contain client side JavaScript or reference an external JavaScript file using the script “src” attribute.
The `<script>` tag/element is used to incorporate client-side Javascript into your HTML file which can be used to add interactivity and logic to your website The `<script>` tag/element is used to incorporate client-side JavaScript into your HTML file which can be used to add interactivity and logic to your website
``` ```
<script> <script>
@ -15,10 +15,10 @@ The `<script>` tag/element is used to incorporate client-side Javascript into yo
<script src="js/app.js"> <script src="js/app.js">
``` ```
The tag can be used to encompass actual Javascript code right in the HTML itself like this The tag can be used to encompass actual JavaScript code right in the HTML itself like this
``` ```
<script> <script>
alert('hello this is my Javascript doing things!'); alert('hello this is my JavaScript doing things!');
</script> </script>
``` ```
@ -26,15 +26,15 @@ Or you can use it as a way to reference an external javascript file like this
``` ```
<script src="main.js" /> <script src="main.js" />
``` ```
Here the `src` attribute of the element takes in a path to a Javascript file Here the `src` attribute of the element takes in a path to a JavaScript file
Script tags are loaded into your HTML in-order and syncronously so it is usually best practice to add your scripts right before the ending of your `<body>` tag in your HTML like so Script tags are loaded into your HTML in-order and syncronously so it is usually best practice to add your scripts right before the ending of your `<body>` tag in your HTML like so
``` ```
<script src="main.js" /> <script src="main.js" />
<script> <script>
alert('hello this is my Javascript doing things!'); alert('hello this is my JavaScript doing things!');
</script> </script>
</body> </body>
``` ```
You can see the official documentation for the script element on the [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) You can see the official documentation for the script element on the [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)

View File

@ -50,7 +50,7 @@ Any `<a>` link can target the content of an `<iframe>` element. Rather than redi
This example will show a blank `<iframe>` initially, but when you click the link above it will redirect the `<iframe>` to show a YouTube video. This example will show a blank `<iframe>` initially, but when you click the link above it will redirect the `<iframe>` to show a YouTube video.
### Javascript and Iframes ### JavaScript and Iframes
Documents embedded in an `<iframe>` can run JavaScript within their own context (without affecting the parent webpage) as normal. Documents embedded in an `<iframe>` can run JavaScript within their own context (without affecting the parent webpage) as normal.
Any script interaction between the parent webpage and the content of the embedded `<iframe>` is subject to the same-origin policy. This means that if you load the content of the `<iframe>` from a different domain, the browser will block any attempt to access that content with JavaScript. Any script interaction between the parent webpage and the content of the embedded `<iframe>` is subject to the same-origin policy. This means that if you load the content of the `<iframe>` from a different domain, the browser will block any attempt to access that content with JavaScript.

View File

@ -10,7 +10,7 @@ Ionic is an HTML5 mobile app development framework targeted at building hybrid m
Hybrid apps have many benefits over pure native apps, specifically in terms of platform support, speed of development, and access to 3rd party code. Hybrid apps have many benefits over pure native apps, specifically in terms of platform support, speed of development, and access to 3rd party code.
## Building Hybrid Apps With Ionic ## Building Hybrid Apps With Ionic
Those familiar with web development will find the structure of an Ionic app straightforward. At its core, its just a web page running in an native app shell! That means we can use any kind of HTML, CSS, and Javascript we want. Those familiar with web development will find the structure of an Ionic app straightforward. At its core, its just a web page running in an native app shell! That means we can use any kind of HTML, CSS, and JavaScript we want.
As of Ionic 2, the framwork uses Angular (previously using AngularJS), please see seperate freeCodeCamp guides on Angular. As of Ionic 2, the framwork uses Angular (previously using AngularJS), please see seperate freeCodeCamp guides on Angular.

View File

@ -41,7 +41,7 @@ title: JavaScript Tutorials and Other Resources
* [The Modern JavaScript Tutorial](https://javascript.info/) * [The Modern JavaScript Tutorial](https://javascript.info/)
* [Introduction to JavaScript: First Steps](https://www.educative.io/collection/5679346740101120/5720605454237696) * [Introduction to JavaScript: First Steps](https://www.educative.io/collection/5679346740101120/5720605454237696)
* [JavaScript for Cats](http://jsforcats.com/) * [JavaScript for Cats](http://jsforcats.com/)
* [Javascript.com by Pluralsight](https://www.javascript.com/learn) * [JavaScript.com by Pluralsight](https://www.javascript.com/learn)
* [SoloLearn JavaScript Tutorial](https://www.sololearn.com/Course/JavaScript/) * [SoloLearn JavaScript Tutorial](https://www.sololearn.com/Course/JavaScript/)
* [GeeksforGeeks](https://www.geeksforgeeks.org/javascript-tutorial/) * [GeeksforGeeks](https://www.geeksforgeeks.org/javascript-tutorial/)
* [Udacity Intro to JavaScript](https://eu.udacity.com/course/intro-to-javascript--ud803) * [Udacity Intro to JavaScript](https://eu.udacity.com/course/intro-to-javascript--ud803)
@ -54,7 +54,7 @@ title: JavaScript Tutorials and Other Resources
* [Derek Banas - Learn JS In One Video](https://www.youtube.com/watch?v=fju9ii8YsGs) * [Derek Banas - Learn JS In One Video](https://www.youtube.com/watch?v=fju9ii8YsGs)
* [Derek Banas - Object Oriented JavaScript](https://www.youtube.com/watch?v=O8wwnhdkPE4) * [Derek Banas - Object Oriented JavaScript](https://www.youtube.com/watch?v=O8wwnhdkPE4)
* [JavaScript Fundamentals for Absolute Beginners 2018](https://www.youtube.com/watch?v=YMvzfQSI6pQ) * [JavaScript Fundamentals for Absolute Beginners 2018](https://www.youtube.com/watch?v=YMvzfQSI6pQ)
* [Udemy - Javascript Understanding the Weird Parts (_first 3.5 hrs_)](https://www.youtube.com/watch?v=Bv_5Zv5c-Ts) * [Udemy - JavaScript Understanding the Weird Parts (_first 3.5 hrs_)](https://www.youtube.com/watch?v=Bv_5Zv5c-Ts)
* [Functional programming in JavaScript](https://www.youtube.com/playlist?list=PL0zVEGEvSaeEd9hlmCXrk5yUyqUag-n84) * [Functional programming in JavaScript](https://www.youtube.com/playlist?list=PL0zVEGEvSaeEd9hlmCXrk5yUyqUag-n84)
* [Douglas Crockford's Videos](https://www.youtube.com/watch?v=v2ifWcnQs6M&index=1&list=PL62E185BB8577B63D) * [Douglas Crockford's Videos](https://www.youtube.com/watch?v=v2ifWcnQs6M&index=1&list=PL62E185BB8577B63D)
* [Gordon Zhu - Practical JavaScript](https://watchandcode.com/p/practical-javascript) * [Gordon Zhu - Practical JavaScript](https://watchandcode.com/p/practical-javascript)
@ -75,7 +75,7 @@ title: JavaScript Tutorials and Other Resources
* [WebStorm](https://www.jetbrains.com/webstorm) * [WebStorm](https://www.jetbrains.com/webstorm)
A full-feature IDE for Javascript, including code completion and support for live linting, version control, and testing. Made by JetBrains and modelled after their IntelliJ Java IDE. A full-feature IDE for JavaScript, including code completion and support for live linting, version control, and testing. Made by JetBrains and modelled after their IntelliJ Java IDE.
* <a href='http://brackets.io' target='_blank' rel='nofollow'>Brackets</a> * <a href='http://brackets.io' target='_blank' rel='nofollow'>Brackets</a>
@ -151,7 +151,7 @@ title: JavaScript Tutorials and Other Resources
6 books on JavaScript by Kyle Simpson. From beginner to advanced. 6 books on JavaScript by Kyle Simpson. From beginner to advanced.
* [Eloquent Javascript](https://eloquentjavascript.net/) * [Eloquent JavaScript](https://eloquentjavascript.net/)
Fantastic, thorough introduction to the basics and features of JavaScript, complete with in-browser interactive code Fantastic, thorough introduction to the basics and features of JavaScript, complete with in-browser interactive code
@ -165,8 +165,8 @@ title: JavaScript Tutorials and Other Resources
* [Learning JavaScript Design Patterns](http://addyosmani.com/resources/essentialjsdesignpatterns/book) * [Learning JavaScript Design Patterns](http://addyosmani.com/resources/essentialjsdesignpatterns/book)
* [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript) * [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)
* [Javascript Allonge Six](https://leanpub.com/javascriptallongesix/read) * [JavaScript Allonge Six](https://leanpub.com/javascriptallongesix/read)
* [The JavaScript Way](https://github.com/bpesquet/thejsway) * [The JavaScript Way](https://github.com/bpesquet/thejsway)
* [Modern JS Cheatsheet](https://mbeaudru.github.io/modern-js-cheatsheet) * [Modern JS Cheatsheet](https://mbeaudru.github.io/modern-js-cheatsheet)
* [Speaking Javascript](http://speakingjs.com/es5) * [Speaking JavaScript](http://speakingjs.com/es5)
* [Exploring ES6](http://exploringjs.com/es6) * [Exploring ES6](http://exploringjs.com/es6)

View File

@ -8,18 +8,18 @@ Like all computer languages, JavaScript has certain advantages and disadvantages
## Advantages of JavaScript ## Advantages of JavaScript
* **Speed**. Client-side JavaScript is very fast because it can be run immediately within the client-side browser. Unless outside resources are required, JavaScript is unhindered by network calls to a backend server. It also has no need to be compiled on the client side which gives it certain speed advantages (granted, adding some risk dependent on that quality of the code developed). * **Speed**. Client-side JavaScript is very fast because it can be run immediately within the client-side browser. Unless outside resources are required, JavaScript is unhindered by network calls to a backend server. It also has no need to be compiled on the client side which gives it certain speed advantages (granted, adding some risk dependent on that quality of the code developed).
* **Simplicity**. JavaScript is relatively simple to learn and implement. * **Simplicity**. JavaScript is relatively simple to learn and implement.
* **Popularity**. JavaScript is used everywhere in the web. The resources to learn JavaScript are numerous. StackOverflow and GitHub have many projects that are using Javascript and the language as a whole has gained a lot of traction in the industry in recent years especially. * **Popularity**. JavaScript is used everywhere in the web. The resources to learn JavaScript are numerous. StackOverflow and GitHub have many projects that are using JavaScript and the language as a whole has gained a lot of traction in the industry in recent years especially.
* **Interoperability**. JavaScript plays nicely with other languages and can be used in a huge variety of applications. Unlike PHP or [SSI](https://en.wikipedia.org/wiki/Server_Side_Includes) scripts, JavaScript can be inserted into any web page regardless of the file extension. JavaScript can also be used inside scripts written in other languages such as Perl and PHP. * **Interoperability**. JavaScript plays nicely with other languages and can be used in a huge variety of applications. Unlike PHP or [SSI](https://en.wikipedia.org/wiki/Server_Side_Includes) scripts, JavaScript can be inserted into any web page regardless of the file extension. JavaScript can also be used inside scripts written in other languages such as Perl and PHP.
* **Server Load**. Being client-side reduces the demand on the website server. * **Server Load**. Being client-side reduces the demand on the website server.
* **Rich interfaces**. Drag and drop components or slider may give a rich interface to your website. * **Rich interfaces**. Drag and drop components or slider may give a rich interface to your website.
* **Extended Functionality**. Third party add-ons like Greasemonkey enable JavaScript developers to write snippets of JavaScript which can execute on desired web pages to extend its functionality. * **Extended Functionality**. Third party add-ons like Greasemonkey enable JavaScript developers to write snippets of JavaScript which can execute on desired web pages to extend its functionality.
* **Frameworks**. If there is anything JavaScript could thank for its wild success, it is frameworks. With the rise in demand of the popular [MEAN Stack](https://en.wikipedia.org/wiki/MEAN_(software_bundle)), JavaScript is giving developers a true bang for their buck. In addition to Node and React, both extremely helpful in web development and continually trending, other frameworks such as [React Native](https://facebook.github.io/react-native/), are giving JavaScript developers the ability to create their own hybrid mobile applications. Also, building desktop applications with JavaScript is possible by using the [Electron Framework](https://electronjs.org). With just one language, developers can, and will, go far with JavaScript. * **Frameworks**. If there is anything JavaScript could thank for its wild success, it is frameworks. With the rise in demand of the popular [MEAN Stack](https://en.wikipedia.org/wiki/MEAN_(software_bundle)), JavaScript is giving developers a true bang for their buck. In addition to Node and React, both extremely helpful in web development and continually trending, other frameworks such as [React Native](https://facebook.github.io/react-native/), are giving JavaScript developers the ability to create their own hybrid mobile applications. Also, building desktop applications with JavaScript is possible by using the [Electron Framework](https://electronjs.org). With just one language, developers can, and will, go far with JavaScript.
* **Versatility**. Nowadays, there are many ways to use JavaScript through [Node.js](https://nodejs.org/en/) servers. If you were to bootstrap node.js with Express, use a document database like [MongoDB](https://www.mongodb.com/), and use JavaScript on the front-end for clients, it is possible to develop an entire JavaScript app from front to back using only JavaScript. * **Versatility**. Nowadays, there are many ways to use JavaScript through [Node.js](https://nodejs.org/en/) servers. If you were to bootstrap node.js with Express, use a document database like [MongoDB](https://www.mongodb.com/), and use JavaScript on the front-end for clients, it is possible to develop an entire JavaScript app from front to back using only JavaScript.
* **Updates**. Since the advent of EcmaScript 5 (the scripting specification that Javascript relies on), Ecma International has dedicated to updating JavaScript annually. So far, we have received browser support for ES6 in 2017 and look forward to ES7 being supported in future months. * **Updates**. Since the advent of EcmaScript 5 (the scripting specification that JavaScript relies on), Ecma International has dedicated to updating JavaScript annually. So far, we have received browser support for ES6 in 2017 and look forward to ES7 being supported in future months.
* **Asynchronous nature**. Javascript is Asynchronous in nature which means that it doesn't freeze the working of other features if any function is taking lot of time to execute maybe a fethch request. * **Asynchronous nature**. JavaScript is Asynchronous in nature which means that it doesn't freeze the working of other features if any function is taking lot of time to execute maybe a fethch request.
## Disadvantages of JavaScript ## Disadvantages of JavaScript
* **Client-Side Security**. Because the code executes on the user's computer, in some cases it can be exploited for malicious purposes. This is one reason some people choose to disable Javascript. * **Client-Side Security**. Because the code executes on the user's computer, in some cases it can be exploited for malicious purposes. This is one reason some people choose to disable JavaScript.
* **Browser Support**. JavaScript is sometimes interpreted differently by different browsers. Whereas server-side scripts will always produce the same output, client-side scripts can be a little unpredictable. Don't be overly concerned by this though - as long as you test your script in all the major browsers you should be safe. Also, there are services out there that will allow you to test your code automatically on check-in of an update to make sure all browsers support your code. * **Browser Support**. JavaScript is sometimes interpreted differently by different browsers. Whereas server-side scripts will always produce the same output, client-side scripts can be a little unpredictable. Don't be overly concerned by this though - as long as you test your script in all the major browsers you should be safe. Also, there are services out there that will allow you to test your code automatically on check-in of an update to make sure all browsers support your code.
* **Browser Optionality**. Most browsers come with features to disable JavaScript, and your website or application may not work properly if it is disabled. * **Browser Optionality**. Most browsers come with features to disable JavaScript, and your website or application may not work properly if it is disabled.
* **Script Visibility**. JavaScript code is always visible to everyone. * **Script Visibility**. JavaScript code is always visible to everyone.

View File

@ -6,7 +6,7 @@ title: Boolean
Boolean is a primitive data type commonly used in computer programming languages. By definition, a boolean has two possible values: `true` or `false`. Boolean is a primitive data type commonly used in computer programming languages. By definition, a boolean has two possible values: `true` or `false`.
In Javascript, there is often implicit type coercion to boolean. If, for example, you have an if statement which checks a certain expression, that expression will be coerced to a boolean: In JavaScript, there is often implicit type coercion to boolean. If, for example, you have an if statement which checks a certain expression, that expression will be coerced to a boolean:
```javascript ```javascript
var a = 'a string'; var a = 'a string';

View File

@ -1,11 +1,11 @@
--- ---
title: Callback Functions title: Callback Functions
--- ---
This article gives a brief introduction to the concept and usage of callback functions in the Javascript programming language. This article gives a brief introduction to the concept and usage of callback functions in the JavaScript programming language.
## Functions are Objects ## Functions are Objects
The first thing we need to know is that in Javascript, functions are first-class objects. As such, we can work with them in the same way we work with other objects, like assigning them to variables and passing them as arguments into other functions. This is important, because it's the latter technique that allows us to extend functionality in our applications. The first thing we need to know is that in JavaScript, functions are first-class objects. As such, we can work with them in the same way we work with other objects, like assigning them to variables and passing them as arguments into other functions. This is important, because it's the latter technique that allows us to extend functionality in our applications.
## Callback Functions ## Callback Functions
@ -41,7 +41,7 @@ createQuote("eat your vegetables!", function(quote){
}); });
``` ```
Incidentally, you don't _have_ to use the word "callback" as the name of your argument, Javascript just needs to know that it's the correct argument name. Based on the above example, the below function will behave in exactly the same manner. Incidentally, you don't _have_ to use the word "callback" as the name of your argument, JavaScript just needs to know that it's the correct argument name. Based on the above example, the below function will behave in exactly the same manner.
```javascript ```javascript
function createQuote(quote, functionToCall) { function createQuote(quote, functionToCall) {

View File

@ -4,7 +4,7 @@ title: Closures
# Closures # Closures
A closure is the combination of a function and the lexical environment (scope) within which that function was declared. Closures are a fundamental and powerful property of Javascript. This article discusses the 'how' and 'why' about Closures: A closure is the combination of a function and the lexical environment (scope) within which that function was declared. Closures are a fundamental and powerful property of JavaScript. This article discusses the 'how' and 'why' about Closures:
@ -97,7 +97,7 @@ In this example, we won't be able to access `balance` from anywhere outside of t
<b>Emulating block-scoped variables.</b> <b>Emulating block-scoped variables.</b>
Javascript did not have a concept of block-scoped variables. Meaning that when defining a variable inside a forloop for example, this variable is visible from outside the forloop as well. So how can closures help us solve this problem ? Let's take a look. JavaScript did not have a concept of block-scoped variables. Meaning that when defining a variable inside a forloop for example, this variable is visible from outside the forloop as well. So how can closures help us solve this problem ? Let's take a look.
```javascript ```javascript
var funcs = []; var funcs = [];
@ -145,7 +145,7 @@ Closures have many special applications that are useful when creating large java
<b>Emulating private variables.</b> <b>Emulating private variables.</b>
Unlike many other languages, Javascript does not have a mechanism which allows you to create encapsulated instance variables within an object. Having public instance variables can cause a lot of problems when building medium to large programs. However with closures, this problem can be mitigated. Unlike many other languages, JavaScript does not have a mechanism which allows you to create encapsulated instance variables within an object. Having public instance variables can cause a lot of problems when building medium to large programs. However with closures, this problem can be mitigated.
Much like in the previous example, you can build functions which return object literals with methods that have access to the object's local variables without exposing them. Thus, making them effectively private. Much like in the previous example, you can build functions which return object literals with methods that have access to the object's local variables without exposing them. Thus, making them effectively private.
@ -204,7 +204,7 @@ for(var i = 0; i <= 10; ++i) {
``` ```
While running the above function, it'll print the 10th power for all the iterations. The reason behind this scenario is, the for loop is iterating over the values and calls the readFile function asynchronouly; when the callback function gets the data, the value of the variable <b>pw</b> already becomes <b>10</b> and that is why the all the loop iteration uses the power as last values. While running the above function, it'll print the 10th power for all the iterations. The reason behind this scenario is, the for loop is iterating over the values and calls the readFile function asynchronouly; when the callback function gets the data, the value of the variable <b>pw</b> already becomes <b>10</b> and that is why the all the loop iteration uses the power as last values.
To mitigate this we can use closure function. We can keep the codes inside the loop in a closure function and then the variable <b>pw</b> will be inside the scope of closure function and it will be fixed for an iteration. While running a callback function for iteration fifth, it won't be overridden by the values of other iteration as the `var pw` will be scoped inside the closure function. This concept is called Immediately Invoked Function Expressions in Javascript To mitigate this we can use closure function. We can keep the codes inside the loop in a closure function and then the variable <b>pw</b> will be inside the scope of closure function and it will be fixed for an iteration. While running a callback function for iteration fifth, it won't be overridden by the values of other iteration as the `var pw` will be scoped inside the closure function. This concept is called Immediately Invoked Function Expressions in JavaScript
``` ```
for(var i = 0; i <= 10; ++i) { for(var i = 0; i <= 10; ++i) {
@ -225,4 +225,4 @@ for(var i = 0; i <= 10; ++i) {
<a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures' target='_blank' rel='nofollow'>MDN</a> <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures' target='_blank' rel='nofollow'>MDN</a>
<br /> <br />
<a href='https://medium.freecodecamp.org/lets-learn-javascript-closures-66feb44f6a44' target='_blank' rel='nofollow'>Javascript Closures</a> <a href='https://medium.freecodecamp.org/lets-learn-javascript-closures-66feb44f6a44' target='_blank' rel='nofollow'>JavaScript Closures</a>

View File

@ -14,7 +14,7 @@ Linters will go through your code, and highlight
Linters can be installed using `npm` or another package manager. Linters can be used from the command line by passing in files. Linters are also available as plugins for tools and sometimes they are directly integrated into editors. Linters can be installed using `npm` or another package manager. Linters can be used from the command line by passing in files. Linters are also available as plugins for tools and sometimes they are directly integrated into editors.
Here are some popular Javascript Linters: Here are some popular JavaScript Linters:
[JSLint](http://www.javascriptlint.com/online_lint.php) [JSLint](http://www.javascriptlint.com/online_lint.php)

View File

@ -4,7 +4,7 @@ title: Concurrency Model and Event Loop
## Concurrency Model and Event Loop ## Concurrency Model and Event Loop
Javascript runtime is single threaded which means that it can execute one piece of code at a time. In order to understand the concurrency model and the event loop in Javascript we have to first get around with some common terms that are associated with it. First let's learn what is a call stack. JavaScript runtime is single threaded which means that it can execute one piece of code at a time. In order to understand the concurrency model and the event loop in JavaScript we have to first get around with some common terms that are associated with it. First let's learn what is a call stack.
A call stack is a simple data structure that records where in the code we are currently. So if we step into a function that is a function invocation it is pushed to the call stack and when we return from a function it is popped out of the stack. A call stack is a simple data structure that records where in the code we are currently. So if we step into a function that is a function invocation it is pushed to the call stack and when we return from a function it is popped out of the stack.
@ -31,7 +31,7 @@ multiply executes and it returns with the multiplied value. Finally the squared
So to summarize whenever a function is invoked it is pushed into the call stack where it executes. Finally when the function is done with it's execution and is returning either implicitly or explicitly it will be popped off the stack. The call stack just records at what point in time which funciton was executing. It keeps track of which function is currently executing. So to summarize whenever a function is invoked it is pushed into the call stack where it executes. Finally when the function is done with it's execution and is returning either implicitly or explicitly it will be popped off the stack. The call stack just records at what point in time which funciton was executing. It keeps track of which function is currently executing.
Now we know from this that Javascript can execute one thing at a time but that's not the case with the Browser. The Browser has it's own set of API's like setTimeout, XMLHttpRequests which are not specified in the Javascript runtime. In fact if you look through the source code of V8, the popular Javascript runtime that powers browsers like Google Chrome you won't find any definitions for it. It's because these special web API's exist in the browser environment not inside the javascript environment and you can say that these apis introduces concurrency into the mix. Let's look at a diagram to understand the whole picture. Now we know from this that JavaScript can execute one thing at a time but that's not the case with the Browser. The Browser has it's own set of API's like setTimeout, XMLHttpRequests which are not specified in the JavaScript runtime. In fact if you look through the source code of V8, the popular JavaScript runtime that powers browsers like Google Chrome you won't find any definitions for it. It's because these special web API's exist in the browser environment not inside the javascript environment and you can say that these apis introduces concurrency into the mix. Let's look at a diagram to understand the whole picture.
![Concurrency and Event Loop Model](https://i.imgur.com/rnQEY7o.png) ![Concurrency and Event Loop Model](https://i.imgur.com/rnQEY7o.png)

View File

@ -4,7 +4,7 @@ title: Destructuring Assignment
## Destructuring Assignment ## Destructuring Assignment
Destructuring Assignment syntax is a Javascript expression that makes it possible to unpack values or properties from arrays or objects. Destructuring Assignment syntax is a JavaScript expression that makes it possible to unpack values or properties from arrays or objects.
Lets say that you have an array that contains a first name and last name as its two values, but you want to reassign those values to something more descriptive. You can use Destructuring to accomplish this. Lets say that you have an array that contains a first name and last name as its two values, but you want to reassign those values to something more descriptive. You can use Destructuring to accomplish this.

View File

@ -73,14 +73,14 @@ console.log(c); // ReferenceError: c is not defined
Consider another example. Consider another example.
``` ```
const LANGUAGES = ['Js', 'Ruby', 'Python', 'Go']; const LANGUAGES = ['Js', 'Ruby', 'Python', 'Go'];
LANGUAGES = "Javascript"; // shows error. LANGUAGES = "JavaScript"; // shows error.
LANGUAGES.push('Java'); // Works fine. LANGUAGES.push('Java'); // Works fine.
console.log(LANGUAGES); // ['Js', 'Ruby', 'Python', 'Go', 'Java'] console.log(LANGUAGES); // ['Js', 'Ruby', 'Python', 'Go', 'Java']
``` ```
This may be little confusing. This may be little confusing.
Consider in this way. Whenever you define a const variable, Javascript references the address of the value to the variable. In our example the variable LANGUAGES actually references to the memory allocated to the array. So you cannot change the variable to reference some other memory location later. Throughout the program it only references to the array. Consider in this way. Whenever you define a const variable, JavaScript references the address of the value to the variable. In our example the variable LANGUAGES actually references to the memory allocated to the array. So you cannot change the variable to reference some other memory location later. Throughout the program it only references to the array.
## Further Reading ## Further Reading

View File

@ -43,7 +43,7 @@ myObject.fullName(); // Function invoked as a method, will return "John
### Arrow Functions ### Arrow Functions
In the newest version of Javascript, you can also shorten the syntax by using Arrow Functions. In the newest version of JavaScript, you can also shorten the syntax by using Arrow Functions.
The following demonstrates two functions. One is written in the standard form, one is written as an arrow function. Keep in mind that arrow functions do not have their own this, arguments, super, or new.target. The following demonstrates two functions. One is written in the standard form, one is written as an arrow function. Keep in mind that arrow functions do not have their own this, arguments, super, or new.target.
```javascript ```javascript

View File

@ -39,4 +39,4 @@ The global object also contains the properties `NaN`, `undefined` and `Infinity`
# References # References
1. MSDN: <a href='https://msdn.microsoft.com/en-us/library/52f50e9t' target='_blank' rel='nofollow'>Global Object (Javascript)</a> 1. MSDN: <a href='https://msdn.microsoft.com/en-us/library/52f50e9t' target='_blank' rel='nofollow'>Global Object (JavaScript)</a>

View File

@ -36,7 +36,7 @@ console.log(window.dog); //Fluffy
Its a best practice to minimize global variables. Since the variable can be accessed anywhere in the program, they can cause strange behavior. Its a best practice to minimize global variables. Since the variable can be accessed anywhere in the program, they can cause strange behavior.
References: References:
* [var -Javascript|MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var) * [var -JavaScript|MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var)
* [You Don't Know JavaScript: Scopes & Closures](https://github.com/getify/You-Dont-Know-JS/tree/master/scope%20%26%20closures) * [You Don't Know JavaScript: Scopes & Closures](https://github.com/getify/You-Dont-Know-JS/tree/master/scope%20%26%20closures)
Additional Info: Additional Info:

View File

@ -133,5 +133,5 @@ There are limitations to this for example, the int 3 and the string '3' will be
See the guide on [Closures](https://guide.freecodecamp.org/javascript/closures) for more information on how `multiplyByTwo` keeps a reference to `num1` in the example above. See the guide on [Closures](https://guide.freecodecamp.org/javascript/closures) for more information on how `multiplyByTwo` keeps a reference to `num1` in the example above.
- [More info about Closures](https://eloquentjavascript.net/05_higher_order.html) - [More info about Closures](https://eloquentjavascript.net/05_higher_order.html)
- [Eloquent Javascript](https://eloquentjavascript.net/05_higher_order.html) - [Eloquent JavaScript](https://eloquentjavascript.net/05_higher_order.html)
- [Medium Article](https://medium.freecodecamp.org/higher-order-functions-in-javascript-d9101f9cf528) - [Medium Article](https://medium.freecodecamp.org/higher-order-functions-in-javascript-d9101f9cf528)

View File

@ -37,11 +37,11 @@ The HTML now will be like
***SECURITY CONSIDERATIONS*** ***SECURITY CONSIDERATIONS***
The value that's set to `innerHTML` should come from trusted sources, since Javascript will put anything inside that element and it will be run as plain HTML. The value that's set to `innerHTML` should come from trusted sources, since JavaScript will put anything inside that element and it will be run as plain HTML.
Example: Example:
Setting a "`<script>alert();</script>`" value will cause the Javascript "alert()" function to be fired: Setting a "`<script>alert();</script>`" value will cause the JavaScript "alert()" function to be fired:
```javascript ```javascript

View File

@ -3,7 +3,7 @@ title: Immutable Types
--- ---
> Immutable means unchangeable i.e. you can't change. > Immutable means unchangeable i.e. you can't change.
Javascript has lots of immutable types e.g. `string` primitive type. Try this in your console. JavaScript has lots of immutable types e.g. `string` primitive type. Try this in your console.
s = "red"; s = "red";
console.log(s[1]); //→ "e" console.log(s[1]); //→ "e"

View File

@ -17,16 +17,16 @@ or watch this [inspiring video from Preethi Kasireddy](https://www.youtube.com/w
## A Short History of JavaScript ## A Short History of JavaScript
<h3>1996:</h3> <h3>1996:</h3>
<p>It changed from LIVESCRIPT to JAVASCRIPT to attract developers.<br> <p>It changed from LiveScript to JavaScript to attract developers.<br>
*JavaScript has nothing to do with Java.</p> *JavaScript has nothing to do with Java.</p>
<h3>1997:</h3> <h3>1997:</h3>
<p>JAVASCRIPT was sold to ECMA and become,<br> <p>JavaScript was sold to ECMA and become,<br>
the first version of JAVASCRIPT Language Standerd.</p> the first version of JavaScript Language Standerd.</p>
<h3>2009:</h3> <h3>2009:</h3>
<p>ES5 (ECMASCRIPT 5) was released with lots of new features.</p> <p>ES5 (ECMAScript 5) was released with lots of new features.</p>
<h3>2015:</h3> <h3>2015:</h3>
<p>It changed to annual realease cycle,<br> <p>It changed to annual realease cycle,<br>
It means JAVASCRIPT releases new Updates every year.<br> It means JavaScript releases new Updates every year.<br>
(With small feature Updates.)</p> (With small feature Updates.)</p>
<h3>2016/ 2017/18/19:</h3> <h3>2016/ 2017/18/19:</h3>
<p>Releases of versions - ES2016/ ES2017/ ES2018/....</p> <p>Releases of versions - ES2016/ ES2017/ ES2018/....</p>

View File

@ -86,5 +86,5 @@ true || (anything) // short-circuit evaluated to true.
Note that where `&&` returns the first value, `||` returns the second value and vice versa. Note that where `&&` returns the first value, `||` returns the second value and vice versa.
## Additional Resources ## Additional Resources
- [Javascript Truth Table](https://guide.freecodecamp.org/javascript/truth-table) - [JavaScript Truth Table](https://guide.freecodecamp.org/javascript/truth-table)
- [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Logical_Operators) - [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Logical_Operators)

View File

@ -131,7 +131,7 @@ myFun.method1();
Pseudoclassical Instantiation is by far contains the least amount of code. Rather than creating a new object and returning it, the new keyword does that for us. Under the hood, when you use the new keyword to instantiate an object, you create a new object using this = Object.create(Object.prototype), where this refers to the prototype that is named after the new keyword. When we are defining our methods, we use the prototype keyword. Pseudoclassical Instantiation is by far contains the least amount of code. Rather than creating a new object and returning it, the new keyword does that for us. Under the hood, when you use the new keyword to instantiate an object, you create a new object using this = Object.create(Object.prototype), where this refers to the prototype that is named after the new keyword. When we are defining our methods, we use the prototype keyword.
## Why would I use it? ## Why would I use it?
Pseudoclassical is said to be the fastest instantiation pattern, which is helpful if you are creating tens of thousands of instances. It is also the most optimized since it utilizes Javascript functionality. Pseudoclassical is said to be the fastest instantiation pattern, which is helpful if you are creating tens of thousands of instances. It is also the most optimized since it utilizes JavaScript functionality.
## What are the drawbacks? ## What are the drawbacks?
The downside of Pseudoclassical Instantiation is that it requires a bit more knowledge about what JavaScript is doing under the hood, particularly with the this keyword. This makes this type of object instantiation a bit more complex to understand, especially if someone else is reading your code The downside of Pseudoclassical Instantiation is that it requires a bit more knowledge about what JavaScript is doing under the hood, particularly with the this keyword. This makes this type of object instantiation a bit more complex to understand, especially if someone else is reading your code

View File

@ -3,7 +3,7 @@ title: Object Instantiation
--- ---
## Object Instantiation ## Object Instantiation
In Javascript and most other languages, an object contains a series of properties, which are a key, value pair. There are multiple options available to you when you need to construct an object. In JavaScript and most other languages, an object contains a series of properties, which are a key, value pair. There are multiple options available to you when you need to construct an object.
### Initialize an object variable ### Initialize an object variable
You can create an object with pre-defined properties like so: You can create an object with pre-defined properties like so:

View File

@ -1,7 +1,7 @@
--- ---
title: Semicolons title: Semicolons
--- ---
Semicolons are not required in Javascript. This is because Javascript has a feature called "Automatic Semicolon Insertion" or ASI for short. ASI puts semicolons in your Javascript for you. It is always active by default and it's a part of the language and can not be disabled. Semicolons are not required in JavaScript. This is because JavaScript has a feature called "Automatic Semicolon Insertion" or ASI for short. ASI puts semicolons in your JavaScript for you. It is always active by default and it's a part of the language and can not be disabled.
ASI has a set of rules it uses to determine where it should insert semicolons. If there is already a semicolon in place, it won't change anything. See <a href='http://stackoverflow.com/a/2846298/3467946' target='_blank' rel='nofollow'>this StackOverflow answer</a> for more information on how ASI works. ASI has a set of rules it uses to determine where it should insert semicolons. If there is already a semicolon in place, it won't change anything. See <a href='http://stackoverflow.com/a/2846298/3467946' target='_blank' rel='nofollow'>this StackOverflow answer</a> for more information on how ASI works.
@ -18,7 +18,7 @@ A consistent coding style makes code more readable. Decide whether you will or w
## Errors you might run into ## Errors you might run into
When Javascript was first made it was meant to aid beginners to get into programming. Nobody wants to be searching for a dang semi-colon in their code when they first start programming. So the choice of semi-colons was implemented, as stated above they are technically there. When JavaScript was first made it was meant to aid beginners to get into programming. Nobody wants to be searching for a dang semi-colon in their code when they first start programming. So the choice of semi-colons was implemented, as stated above they are technically there.
For example: For example:
```javasctipt ```javasctipt
@ -32,7 +32,7 @@ let z = foo(10);
z(10)// TypeError z is not a function z(10)// TypeError z is not a function
// Because of Automatic Semicolon Insertion, our inner function does not exist. // Because of Automatic Semicolon Insertion, our inner function does not exist.
``` ```
Javascript will implement semi-colons where they are expected. JavaScript will implement semi-colons where they are expected.
### Other resources ### Other resources

View File

@ -3,11 +3,11 @@ title: JSON Arrays
--- ---
## JSON Arrays ## JSON Arrays
JSON Arrays are no different from normal array object that you use in Javascript. Its an array object which contains multiple `JSON Objects`. JSON Arrays are no different from normal array object that you use in JavaScript. Its an array object which contains multiple `JSON Objects`.
Here is an example of a JSON Array: Here is an example of a JSON Array:
```Javascript ```JavaScript
var aMyPlaylist = [{ var aMyPlaylist = [{
artist: "Ed Sheeran", artist: "Ed Sheeran",
track: "Supermarket flowers", track: "Supermarket flowers",
@ -25,4 +25,4 @@ This is an JSON Array named as `aMyPlaylist`. All array methods like `map`, `fil
More array methods can be found in following links More array methods can be found in following links
- <a href='https://guide.freecodecamp.org/javascript/standard-objects/array' target='_blank' rel='nofollow'>Array - Freecodecamp</a> - <a href='https://guide.freecodecamp.org/javascript/standard-objects/array' target='_blank' rel='nofollow'>Array - Freecodecamp</a>
- <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array' target='_blank' rel='nofollow'>Array - Mozilla Developer Network</a> - <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array' target='_blank' rel='nofollow'>Array - Mozilla Developer Network</a>

View File

@ -3,7 +3,7 @@ title: How to Create a Dropdown Menu with CSS and JavaScript
--- ---
## How to Create a Dropdown Menu with CSS and JavaScript ## How to Create a Dropdown Menu with CSS and JavaScript
In this tutorial you will learn how to create a simple dropdown menu with vanilla Javascript, HTML and CSS. We will walk through the HTML, CSS and Javascript code, but paying more attention to the programming, since this is a JS tutorial. We'll use just plain JS and CSS, with no frameworks or preprocessors. The only (kind-of) exception will be importing the [Font Awesome](https://fontawesome.com/) CSS file because we'll use one of its icons. In this tutorial you will learn how to create a simple dropdown menu with vanilla JavaScript, HTML and CSS. We will walk through the HTML, CSS and JavaScript code, but paying more attention to the programming, since this is a JS tutorial. We'll use just plain JS and CSS, with no frameworks or preprocessors. The only (kind-of) exception will be importing the [Font Awesome](https://fontawesome.com/) CSS file because we'll use one of its icons.
This is targeted to developers that have an average understanding of HTML, CSS and JS. I tried to make it as clean as possible, but I won't focus too much on details here. I hope you all enjoy. This is targeted to developers that have an average understanding of HTML, CSS and JS. I tried to make it as clean as possible, but I won't focus too much on details here. I hope you all enjoy.
@ -130,7 +130,7 @@ body{
``` ```
#### JavaScript: #### JavaScript:
Now we'll see how the Javascript part is implemented. We'll first go through the function definitions Now we'll see how the JavaScript part is implemented. We'll first go through the function definitions
and then the code that calls these functions to make the dropdown actions happen. and then the code that calls these functions to make the dropdown actions happen.
Basically, there are 3 actions that take place depending on what the user interaction is, as their listeners are added to the DOM elements: Basically, there are 3 actions that take place depending on what the user interaction is, as their listeners are added to the DOM elements:
@ -141,7 +141,7 @@ Basically, there are 3 actions that take place depending on what the user intera
I'd like to make it clear that we are using arrow functions( `() => {}` ) and the `const` keyword, which are ES6 features. You're probably good if you're using a recent version of your browser, but keep that in mind. I'd like to make it clear that we are using arrow functions( `() => {}` ) and the `const` keyword, which are ES6 features. You're probably good if you're using a recent version of your browser, but keep that in mind.
#### 1. Clicking on the dropdown element #### 1. Clicking on the dropdown element
```Javascript ```JavaScript
function toggleClass(elem,className){ function toggleClass(elem,className){
if (elem.className.indexOf(className) !== -1){ if (elem.className.indexOf(className) !== -1){
elem.className = elem.className.replace(className,''); elem.className = elem.className.replace(className,'');
@ -179,7 +179,7 @@ When the dropdown element is clicked, it opens(if it is closed) or closes(if it
#### 2. Selecting one of the dropdown options #### 2. Selecting one of the dropdown options
```Javascript ```JavaScript
function handleOptionSelected(e){ function handleOptionSelected(e){
toggleClass(e.target.parentNode, 'hide'); toggleClass(e.target.parentNode, 'hide');
@ -199,7 +199,7 @@ function handleOptionSelected(e){
} }
``` ```
#### 3. Changing the currently selected option #### 3. Changing the currently selected option
```Javascript ```JavaScript
function handleTitleChange(e){ function handleTitleChange(e){
const result = document.getElementById('result'); const result = document.getElementById('result');
@ -210,7 +210,7 @@ function handleTitleChange(e){
The function `handleTitleChange` is bound to the custom `change` event on the `.title` element, to change the `#result` element content whenever the title element changes. This event's triggering is done on the previous section. The function `handleTitleChange` is bound to the custom `change` event on the `.title` element, to change the `#result` element content whenever the title element changes. This event's triggering is done on the previous section.
#### Main code #### Main code
```Javascript ```JavaScript
//get elements //get elements
const dropdownTitle = document.querySelector('.dropdown .title'); const dropdownTitle = document.querySelector('.dropdown .title');
@ -230,4 +230,4 @@ This application's full code and demo can be found [here](https://codepen.io/GCr
## More Information ## More Information
* [ES6 introduction](https://guide.freecodecamp.org/javascript/es6) * [ES6 introduction](https://guide.freecodecamp.org/javascript/es6)
* [Arrow functions](https://guide.freecodecamp.org/javascript/es6/arrow-functions/) * [Arrow functions](https://guide.freecodecamp.org/javascript/es6/arrow-functions/)
* [Let and Const](https://guide.freecodecamp.org/javascript/es6/let-and-const/) * [Let and Const](https://guide.freecodecamp.org/javascript/es6/let-and-const/)

View File

@ -3,7 +3,7 @@ title: Using Anonymous Functions for Private Namespacing in Your JavaScript Apps
--- ---
Let's take a look at what a namespace is when it comes to building JavaScript applications and some of the benefits from using a private namespace when building your apps. Let's take a look at what a namespace is when it comes to building JavaScript applications and some of the benefits from using a private namespace when building your apps.
**Please note that this article references anonymous self-executing functions. If you're unaware of what this is, please read this excellent article by Noah Stokes: <a href='http://esbueno.noahstokes.com/post/77292606977/self-executing-anonymous-functions-or-how-to-write' target='_blank' rel='nofollow'>Self-Executing Anonymous Functions or How to Write Clean Javascript</a>. This article will go into detail about anonymous self-executing functions.** **Please note that this article references anonymous self-executing functions. If you're unaware of what this is, please read this excellent article by Noah Stokes: <a href='http://esbueno.noahstokes.com/post/77292606977/self-executing-anonymous-functions-or-how-to-write' target='_blank' rel='nofollow'>Self-Executing Anonymous Functions or How to Write Clean JavaScript</a>. This article will go into detail about anonymous self-executing functions.**
## What is a Namespace? ## What is a Namespace?
@ -35,7 +35,7 @@ To break this down into simpler terms from a real life scenario, let's say you a
## Achieving a Private Namespace ## Achieving a Private Namespace
So, how do we achieve this **private namespace** in JavaScript? Use an anonymous self-executing function! If you didn't read the article by Noah Stokes, <a href='http://esbueno.noahstokes.com/post/77292606977/self-executing-anonymous-functions-or-how-to-write' target='_blank' rel='nofollow'>Self-Executing Anonymous Functions or How to Write Clean Javascript</a>, please do so now. This article will go into detail about anonymous self-executing functions. So, how do we achieve this **private namespace** in JavaScript? Use an anonymous self-executing function! If you didn't read the article by Noah Stokes, <a href='http://esbueno.noahstokes.com/post/77292606977/self-executing-anonymous-functions-or-how-to-write' target='_blank' rel='nofollow'>Self-Executing Anonymous Functions or How to Write Clean JavaScript</a>, please do so now. This article will go into detail about anonymous self-executing functions.
Let's take a look at using that _points_ variable from earlier, but let's separate it into a **private namespace**: Let's take a look at using that _points_ variable from earlier, but let's separate it into a **private namespace**:
@ -71,4 +71,4 @@ is the same as:
document.querySelector('body').style.background = 'blue'; document.querySelector('body').style.background = 'blue';
</script> </script>
Keep in mind that this is just one way to use namespaces in JavaScript applications. Adapt your code to what best fits the situation at hand. Keep in mind that this is just one way to use namespaces in JavaScript applications. Adapt your code to what best fits the situation at hand.

View File

@ -14,11 +14,11 @@ But, **void with operand 0 is preferred**.
**Two ways of using operand 0 -> void(0) or void 0.** Either of them is fine. **Two ways of using operand 0 -> void(0) or void 0.** Either of them is fine.
#### When to use Javascript void (0) ? #### When to use JavaScript void (0) ?
When on link click, you don't want the browser to load a new page or refresh the same page( depending on the URL specified ). When on link click, you don't want the browser to load a new page or refresh the same page( depending on the URL specified ).
Instead,perform the JavaScript attached to that link. Instead,perform the JavaScript attached to that link.
#### Sample Example 1 with Javascript void (0) : #### Sample Example 1 with JavaScript void (0) :
```html ```html
<html> <html>
@ -32,7 +32,7 @@ When clicked on ClickMe link,an alert pops up as below :
![Output1](https://github.com/srawat19/-Guide_Images/blob/master/voidOutput1.PNG?raw=true) ![Output1](https://github.com/srawat19/-Guide_Images/blob/master/voidOutput1.PNG?raw=true)
#### Sample Example 2 with Javascript void (0) : #### Sample Example 2 with JavaScript void (0) :
```html ```html
<html> <html>
@ -45,7 +45,7 @@ When clicked on ClickMe link,an alert pops up as below :
When you double click the link,an alert will popup without any page refresh. When you double click the link,an alert will popup without any page refresh.
#### Sample Example 3 with Javascript void (0) : #### Sample Example 3 with JavaScript void (0) :
```html ```html
<html> <html>
@ -59,7 +59,7 @@ ondblclick="alert('Hello !! You will see me and not get redirected to google.com
When you double click the link,an alert will popup,closing it will also not redirect to google.com. When you double click the link,an alert will popup,closing it will also not redirect to google.com.
#### Sample Example without Javascript void (0) : #### Sample Example without JavaScript void (0) :
```html ```html
<html> <html>

View File

@ -9,7 +9,7 @@ Some of the main features found in Laravel are different ways for accessing rela
Because Laravel is open-source, the community around it is very strong and the documentation is top-notch and example driven. Take a look at the [official documentation](https://laravel.com/docs/5.7/) to get a glimpse of how easy it is to use! Because Laravel is open-source, the community around it is very strong and the documentation is top-notch and example driven. Take a look at the [official documentation](https://laravel.com/docs/5.7/) to get a glimpse of how easy it is to use!
Laravel also has its own online learning platform, [Laracasts](https://laracasts.com/), which offers extensive video tutorials (some free, some available with paid subscription) on Laravel as well as PHP, Javascript, and other web development topics. The free introductory series [Laravel 5.4 From Scratch](https://laracasts.com/series/laravel-from-scratch-2017) is a great place to start. Laravel also has its own online learning platform, [Laracasts](https://laracasts.com/), which offers extensive video tutorials (some free, some available with paid subscription) on Laravel as well as PHP, JavaScript, and other web development topics. The free introductory series [Laravel 5.4 From Scratch](https://laracasts.com/series/laravel-from-scratch-2017) is a great place to start.
## Featured Packages ## Featured Packages
Ready-to-use bundles provided by Laravel through Composer and Packagist include the following: Ready-to-use bundles provided by Laravel through Composer and Packagist include the following:

View File

@ -85,7 +85,7 @@ For binary operators, a condensed form of truth table is also used, where the ro
| T | T | T | | T | T | T |
## Additional Resources ## Additional Resources
- [Logical Operators in Javascript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators) - [Logical Operators in JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators)
- [Logical Operators in PHP](http://php.net/manual/en/language.operators.logical.php) - [Logical Operators in PHP](http://php.net/manual/en/language.operators.logical.php)
- [Logical Operators in C++](http://en.cppreference.com/w/cpp/language/operator_logical) - [Logical Operators in C++](http://en.cppreference.com/w/cpp/language/operator_logical)
- [Wikipedia, Truth table](https://en.wikipedia.org/wiki/Truth_table) - [Wikipedia, Truth table](https://en.wikipedia.org/wiki/Truth_table)

View File

@ -21,7 +21,7 @@ Here is a summary for those who don't have time to watch the full 90 minutes:
**--Challenges--** **--Challenges--**
-[@SaintPeter](/users/saintpeter) is creating ~60 new Javascript Challenges. -[@SaintPeter](/users/saintpeter) is creating ~60 new JavaScript Challenges.
-Also creating new 'checkpoints' that will act like mini-Algorithms during the Challenges. They will be 'blank page' challenges that are intended to ease campers in the transition from Challenges to Algorithms. -Also creating new 'checkpoints' that will act like mini-Algorithms during the Challenges. They will be 'blank page' challenges that are intended to ease campers in the transition from Challenges to Algorithms.

View File

@ -4,7 +4,7 @@ title: Change Text with Click Events
## Different Ways of Handling Click Events ## Different Ways of Handling Click Events
> Coders often face a variety of options when confronting a challenge. One of these is their problem solving strategy. A simple example is letting the user interact with a website in the most basic of ways, a click. Let's take a look at a few different strategies: > Coders often face a variety of options when confronting a challenge. One of these is their problem solving strategy. A simple example is letting the user interact with a website in the most basic of ways, a click. Let's take a look at a few different strategies:
1. HTML onclick 1. HTML onclick
2. Javascript addEventListener 2. JavaScript addEventListener
3. jQuery click event 3. jQuery click event
```html ```html
<body> <body>
@ -19,8 +19,8 @@ title: Change Text with Click Events
function handleClick(message = 'HTML onclick used'){ function handleClick(message = 'HTML onclick used'){
document.getElementById("toChange").innerText = message; document.getElementById("toChange").innerText = message;
} }
// Javascript click events // JavaScript click events
document.getElementById("listening").addEventListener('click', 'Javascript addEventListener used'); document.getElementById("listening").addEventListener('click', 'JavaScript addEventListener used');
// jQuery click events // jQuery click events
$("#listening").click(handleClick, 'jQuery event listener'); $("#listening").click(handleClick, 'jQuery event listener');

View File

@ -1,7 +1,7 @@
--- ---
title: Create an Npm Module title: Create an Npm Module
--- ---
An NPM module is a set of Javascript functionality bundled into a distributable package. <a href='http://www.npmjs.com' target='_blank' rel='nofollow'>NPM</a> maintains the registry of all available packages, and is also the tool used to install packages from its registry. An NPM module is a set of JavaScript functionality bundled into a distributable package. <a href='http://www.npmjs.com' target='_blank' rel='nofollow'>NPM</a> maintains the registry of all available packages, and is also the tool used to install packages from its registry.
The beauty of NPM is that you can assemble packages other people have created to create something new, and someone later on could use the package you create. If you have some code that you want to share with the world, publishing a module to NPM is easy. The beauty of NPM is that you can assemble packages other people have created to create something new, and someone later on could use the package you create. If you have some code that you want to share with the world, publishing a module to NPM is easy.

View File

@ -103,7 +103,7 @@ Before we write code, let us understand how merge sort works with the help of a
![:rocket:](https://forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=3 ":rocket:") <a href='https://repl.it/CYVc/1' target='_blank' rel='nofollow'>Run Code</a> ![:rocket:](https://forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=3 ":rocket:") <a href='https://repl.it/CYVc/1' target='_blank' rel='nofollow'>Run Code</a>
### Javascript Implementation ### JavaScript Implementation
Let's write MergeSort in JavaScript: Let's write MergeSort in JavaScript:

View File

@ -3,7 +3,7 @@ title: Learn About Ruby Hashes
--- ---
### Basics: ### Basics:
* Ruby hashes are comparable to Javascript objects or dictionaries in languages like Python. * Ruby hashes are comparable to JavaScript objects or dictionaries in languages like Python.
* Hashes contain items that are stored by `key: value` pairs. * Hashes contain items that are stored by `key: value` pairs.
* Ruby hashes can be created using the following methods: * Ruby hashes can be created using the following methods:
* `my_hash = {}` * `my_hash = {}`
@ -28,4 +28,4 @@ title: Learn About Ruby Hashes
## References: ## References:
* <a href='http://ruby-doc.org/core-2.2.0/Hash.html' target='_blank' rel='nofollow'>The official Ruby documentation for hashes</a>. * <a href='http://ruby-doc.org/core-2.2.0/Hash.html' target='_blank' rel='nofollow'>The official Ruby documentation for hashes</a>.

View File

@ -8,7 +8,7 @@ There are two ways to format code in Markdown. You can either use inline code, b
## Inline Code ## Inline Code
You can use inline code formatting to emphasise a small command or piece of syntax within a line you're writing. You can use inline code formatting to emphasise a small command or piece of syntax within a line you're writing.
For example, you may wish to mention Javascript's `Array.protoype.map()` function. By using inline code formatting, it is clear that this is a piece of code. You might also use it to illustrate a terminal command, like `yarn install`. For example, you may wish to mention JavaScript's `Array.protoype.map()` function. By using inline code formatting, it is clear that this is a piece of code. You might also use it to illustrate a terminal command, like `yarn install`.
To use inline code formatting, simply wrap the code you wish to format in backticks. On a standard US layout QWERTY keyboard, this can be found to the left of '1', and above Tab. More information on the location of the backtick on international keyboards is provided below. To use inline code formatting, simply wrap the code you wish to format in backticks. On a standard US layout QWERTY keyboard, this can be found to the left of '1', and above Tab. More information on the location of the backtick on international keyboards is provided below.

View File

@ -18,7 +18,7 @@ First let's begin with a brief overview of the .NET platform, and get some jargo
* Class libraries : It contains thousands of in-built classes for your application's use, for example [`System.IO`</a>.aspx) for reading/writing data streams, <a href='https://msdn.microsoft.com/en-us/library/system.net.http.httpclient(v=vs.118' target='_blank' rel='nofollow'>`HttpClient`</a>.aspx) sends data over network, <a href='http://www.asp.net/' target='_blank' rel='nofollow'>`ASP.NET`</a> for web applications, <a href='https://msdn.microsoft.com/en-us/library/h43ks021(v=vs.110' target='_blank' rel='nofollow'>`ADO.NET`</a>.aspx)for data access to relational databases (like Microsoft SQL Server and MySQL), and <a href='https://msdn.microsoft.com/en-us/library/ms735119(v=vs.90' target='_blank' rel='nofollow'>Windows Communication Foundation (WCF)</a>.aspx) for service-oriented applications which communicates over established protocols like HTTP, REST, SOAP and TCP etc. * Class libraries : It contains thousands of in-built classes for your application's use, for example [`System.IO`</a>.aspx) for reading/writing data streams, <a href='https://msdn.microsoft.com/en-us/library/system.net.http.httpclient(v=vs.118' target='_blank' rel='nofollow'>`HttpClient`</a>.aspx) sends data over network, <a href='http://www.asp.net/' target='_blank' rel='nofollow'>`ASP.NET`</a> for web applications, <a href='https://msdn.microsoft.com/en-us/library/h43ks021(v=vs.110' target='_blank' rel='nofollow'>`ADO.NET`</a>.aspx)for data access to relational databases (like Microsoft SQL Server and MySQL), and <a href='https://msdn.microsoft.com/en-us/library/ms735119(v=vs.90' target='_blank' rel='nofollow'>Windows Communication Foundation (WCF)</a>.aspx) for service-oriented applications which communicates over established protocols like HTTP, REST, SOAP and TCP etc.
* The C# Programming Language (_pronounced "C-sharp"_) : C# has a syntax similar to Java, C++, and Javascript. It is: * The C# Programming Language (_pronounced "C-sharp"_) : C# has a syntax similar to Java, C++, and JavaScript. It is:
1. used to write applications, services and reusable libraries. 1. used to write applications, services and reusable libraries.
2. designed to work with .NET platform. 2. designed to work with .NET platform.
@ -31,4 +31,4 @@ First let's begin with a brief overview of the .NET platform, and get some jargo
## The C# programing language ## The C# programing language
Next step to learn the <a>C# programing language</a>. Next step to learn the <a>C# programing language</a>.

View File

@ -26,7 +26,7 @@ We want to draw a US Map and visualize this data such that, when we hover mouse
* First , we will need to create a US map. * First , we will need to create a US map.
1. You can either create a map from scratch using sources like - <a href='https://intridea.github.io/stately/' target='_blank' rel='nofollow'>Stately.</a> 1. You can either create a map from scratch using sources like - <a href='https://intridea.github.io/stately/' target='_blank' rel='nofollow'>Stately.</a>
2. Get a already created map from <a href='http://freehtml5maps.com' target='_blank' rel='nofollow'>freehtml5maps</a> or use this <a href='http://bl.ocks.org/NPashaP/raw/a74faf20b492ad377312/3513ad985b2fa93ea35f2fc864cb30540c298171/uStates.js' target='_blank' rel='nofollow'>Javascript</a> 2. Get a already created map from <a href='http://freehtml5maps.com' target='_blank' rel='nofollow'>freehtml5maps</a> or use this <a href='http://bl.ocks.org/NPashaP/raw/a74faf20b492ad377312/3513ad985b2fa93ea35f2fc864cb30540c298171/uStates.js' target='_blank' rel='nofollow'>JavaScript</a>
* Add your map to the main javascript used for visualization * Add your map to the main javascript used for visualization
For Example, `(script src="uStates.js")(/script) (!-- creates uStates. --)` For Example, `(script src="uStates.js")(/script) (!-- creates uStates. --)`

View File

@ -3,7 +3,7 @@ title: What Is Clojure
--- ---
## Clojure is a dialect of Lisp. ## Clojure is a dialect of Lisp.
Lisps are an entirely separate family of languages to C-like languages such as C#, Javascript, Python or Ruby. This means Lisps might look odd to programmers who are more familiar with these languages. Essentially, being a Lisp means that everything in Clojure is a list containing data (even function calls!), it has dynamic typing, and you can define _macros_ that let you manipulate your own code. Here's a simple example of some Clojure for you to examine: Lisps are an entirely separate family of languages to C-like languages such as C#, JavaScript, Python or Ruby. This means Lisps might look odd to programmers who are more familiar with these languages. Essentially, being a Lisp means that everything in Clojure is a list containing data (even function calls!), it has dynamic typing, and you can define _macros_ that let you manipulate your own code. Here's a simple example of some Clojure for you to examine:
(defn hello-world [] (println "Hello world!")) (defn hello-world [] (println "Hello world!"))
@ -26,7 +26,7 @@ While not being able to change variables might sound nightmarish, it's a lot eas
## Clojure runs on the Java Virtual Machine. ## Clojure runs on the Java Virtual Machine.
The JVM is the virtual machine that interprets Java bytecode and uses it to run a program. This means Clojure works almost seamlessly with code designed for Java (although it does look a bit odd), and it also means that it runs quite quickly compared to some other Lisps. While it's quite a bit slower than Java, it's still a lot faster than Python, Ruby or Javascript. The JVM is the virtual machine that interprets Java bytecode and uses it to run a program. This means Clojure works almost seamlessly with code designed for Java (although it does look a bit odd), and it also means that it runs quite quickly compared to some other Lisps. While it's quite a bit slower than Java, it's still a lot faster than Python, Ruby or JavaScript.
(.indexOf [1 2 3 4] 2) ;; .indexOf is a Java method! (.indexOf [1 2 3 4] 2) ;; .indexOf is a Java method!
; => 1 ; => 1
@ -36,4 +36,4 @@ The JVM is the virtual machine that interprets Java bytecode and uses it to run
"Concurrency" here means "one program working on multiple threads at once," which can make your code much faster. It can also make your code much buggier; imagine if two different functions were changing and reading from the same object at once! It would be utter chaos. Thankfully, in Clojure, variables are immutable, which means there's no chance of this kind of mayhem breaking loose. The language also has a variety of features to make concurrent code easier, such as the Software Transactional Memory system, agents and atoms. "Concurrency" here means "one program working on multiple threads at once," which can make your code much faster. It can also make your code much buggier; imagine if two different functions were changing and reading from the same object at once! It would be utter chaos. Thankfully, in Clojure, variables are immutable, which means there's no chance of this kind of mayhem breaking loose. The language also has a variety of features to make concurrent code easier, such as the Software Transactional Memory system, agents and atoms.
| ![:point_left:](//forum.freecodecamp.com/images/emoji/emoji_one/point_left.png?v=2 ":point_left:") Previous | [![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:") Home ![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:")](//forum.freecodecamp.com/t/clojure-resources/18422) | [Next ![:point_right:](//forum.freecodecamp.com/images/emoji/emoji_one/point_right.png?v=2 ":point_right:")](//forum.freecodecamp.com/t/clojure-the-basics/18410)| | ![:point_left:](//forum.freecodecamp.com/images/emoji/emoji_one/point_left.png?v=2 ":point_left:") Previous | [![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:") Home ![:book:](//forum.freecodecamp.com/images/emoji/emoji_one/book.png?v=2 ":book:")](//forum.freecodecamp.com/t/clojure-resources/18422) | [Next ![:point_right:](//forum.freecodecamp.com/images/emoji/emoji_one/point_right.png?v=2 ":point_right:")](//forum.freecodecamp.com/t/clojure-the-basics/18410)|
| | [Table of Contents](//forum.freecodecamp.com/t/clojure-resources/18422) | [Basics](//forum.freecodecamp.com/t/clojure-the-basics/18410)| | | [Table of Contents](//forum.freecodecamp.com/t/clojure-resources/18422) | [Basics](//forum.freecodecamp.com/t/clojure-the-basics/18410)|

View File

@ -27,7 +27,7 @@ Xamarin is a software company based in San Francisco. It provides commercial sof
PhoneGap is a software development framework by Adobe System, which is used to develop mobile applications. To develop apps using PhoneGap, the developer does not require to have knowledge of mobile programming language but only web-development languages like, HTML, CSS, and JScript. PhoneGap produces apps for all popular mobile OS platforms such as iOS, Android, BlackBerry, and Windows Mobile OS etc. In this tutorial we will focus on developing App for Android platform. This tutorial will give you adequate information about how to produce apps quickly using PhoneGap services. PhoneGap is a software development framework by Adobe System, which is used to develop mobile applications. To develop apps using PhoneGap, the developer does not require to have knowledge of mobile programming language but only web-development languages like, HTML, CSS, and JScript. PhoneGap produces apps for all popular mobile OS platforms such as iOS, Android, BlackBerry, and Windows Mobile OS etc. In this tutorial we will focus on developing App for Android platform. This tutorial will give you adequate information about how to produce apps quickly using PhoneGap services.
#### React Native #### React Native
React Native just like PhoneGap and cordova offers the opportunity for Web Developers to step into the world of Mobile App Development. It is a cross platform mobile application framework from Facebook i,e one can build apps for the Android and ios platform using Javascript (JSX). As opposed to those hybrid apps produced by cordova and phonegap, React Native produces real native apps which can utilise all the native features. It comes with the tagline, "Write once, run everywhere". Usually Tech companies used to had separate teams who would maintain the codebase for ios and android. React Native solves this problem in an effective way allowing Web Developers with React background to build awesome mobile apps. To go on with this track, get started with React. One should be familiar with all those concepts like components, states, props, routing etc. before jumping into React Native. It is also good if one can create bunch of projects in React so as to familiarise with the JSX syntax and all other stuffs which would certainly benefit when it comes into React Native. React Native just like PhoneGap and cordova offers the opportunity for Web Developers to step into the world of Mobile App Development. It is a cross platform mobile application framework from Facebook i,e one can build apps for the Android and ios platform using JavaScript (JSX). As opposed to those hybrid apps produced by cordova and phonegap, React Native produces real native apps which can utilise all the native features. It comes with the tagline, "Write once, run everywhere". Usually Tech companies used to had separate teams who would maintain the codebase for ios and android. React Native solves this problem in an effective way allowing Web Developers with React background to build awesome mobile apps. To go on with this track, get started with React. One should be familiar with all those concepts like components, states, props, routing etc. before jumping into React Native. It is also good if one can create bunch of projects in React so as to familiarise with the JSX syntax and all other stuffs which would certainly benefit when it comes into React Native.
#### PowerApps #### PowerApps
Launched in 2017, PowerApps is a browser-based platform by Microsoft that allows developers and non-developers to build mobile applications from selectable templates or from a blank canvas. PowerApps at its core is a Platform as a Service. It allows you to create Mobile Apps that run on Android, iOS, Windows (Modern Apps) and with almost any Internet browser. It takes care of the differences between the operating systems and just allows you to run your apps. It is essentially a container that makes mobile apps much easier to use across mobile platforms. PowerApps offers to dramatically accelerate how business apps are built, reducing time to solution from weeks or months to minutes and empowering a new category of app creators. Launched in 2017, PowerApps is a browser-based platform by Microsoft that allows developers and non-developers to build mobile applications from selectable templates or from a blank canvas. PowerApps at its core is a Platform as a Service. It allows you to create Mobile Apps that run on Android, iOS, Windows (Modern Apps) and with almost any Internet browser. It takes care of the differences between the operating systems and just allows you to run your apps. It is essentially a container that makes mobile apps much easier to use across mobile platforms. PowerApps offers to dramatically accelerate how business apps are built, reducing time to solution from weeks or months to minutes and empowering a new category of app creators.

View File

@ -10,7 +10,7 @@ title: Node.js
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world. Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
#### Let's break it down. #### Let's break it down.
- Javascript runtime built on Google Chrome's V8 JavaScript engine. - JavaScript runtime built on Google Chrome's V8 JavaScript engine.
Every browser has a JavaSript engine built in it to process JavaScript files contained in websites. Chrome uses V8, which is built using C++. Node.js also uses this super-fast engine to interpret JavaScript files. Every browser has a JavaSript engine built in it to process JavaScript files contained in websites. Chrome uses V8, which is built using C++. Node.js also uses this super-fast engine to interpret JavaScript files.
- Node.js uses an event-driven model. - Node.js uses an event-driven model.
This means that Node.js waits for certain events to take place. It then acts on those events. Events can be anything from a click to a HTTP request. We can also declare our own custom events and make node.js listen for those events. This means that Node.js waits for certain events to take place. It then acts on those events. Events can be anything from a click to a HTTP request. We can also declare our own custom events and make node.js listen for those events.

View File

@ -2,7 +2,7 @@
title: Switch title: Switch
--- ---
## Switch ## Switch
In PHP, the `Switch` statement is very similar to the Javascript `Switch` statement (See the <a href="/javascript/switch-statements">Javascript Switch Guide</a> to compare and contrast). It allows rapid case testing with a lot of different possible conditions, the code is also more readable. In PHP, the `Switch` statement is very similar to the JavaScript `Switch` statement (See the <a href="/javascript/switch-statements">JavaScript Switch Guide</a> to compare and contrast). It allows rapid case testing with a lot of different possible conditions, the code is also more readable.
### Syntax ### Syntax
```php ```php

View File

@ -242,7 +242,7 @@ So lets do a quick recap. In your head tag you grabbed the script tags for Re
You then located the position within the DOM that you wanted to insert your React by creating an element `<div>` with the id of “app”. You then located the position within the DOM that you wanted to insert your React by creating an element `<div>` with the id of “app”.
Next, you created a script tag to input your React code. You used ReactDOM.render() method that takes two arguments. The “what” of the React content, in this case your JSX, and the second argument is the “where” that you want to insert the React content into the DOM. In this case it is the location with the id of “app”. Next, you created a script tag to input your React code. You used ReactDOM.render() method that takes two arguments. The “what” of the React content, in this case your JSX, and the second argument is the “where” that you want to insert the React content into the DOM. In this case it is the location with the id of “app”.
As an alternative to JSX, you can use ES6 and Javascript's compiler like Babel. [https://babeljs.io/](https://babeljs.io/) As an alternative to JSX, you can use ES6 and JavaScript's compiler like Babel. [https://babeljs.io/](https://babeljs.io/)
### More Information: ### More Information:

View File

@ -5,7 +5,7 @@ title: Why React
# Why React.js? # Why React.js?
## Simplicity ## Simplicity
React.js is not a full fledged Javascript framework like Angular.js or other popular frontend frameworks. Instead, React.js is a JavaScript library that acts as the 'V' in MVC (Model View Controller). It is simply a view engine that can be dropped in and used with a plethora of other tools for the data and model part of MVC (most popularly Redux and Node.js). React.js is not a full fledged JavaScript framework like Angular.js or other popular frontend frameworks. Instead, React.js is a JavaScript library that acts as the 'V' in MVC (Model View Controller). It is simply a view engine that can be dropped in and used with a plethora of other tools for the data and model part of MVC (most popularly Redux and Node.js).
## Reusability ## Reusability
React allows you to create reusable components that you can modify with props. This gives a lot of flexibility in development and speeds it up by huge margins. React allows you to create reusable components that you can modify with props. This gives a lot of flexibility in development and speeds it up by huge margins.

View File

@ -105,4 +105,4 @@ Controller (Action controller) interacts with the views and model to direct the
Not only is it free to use, you can also help make it better. More than 4,500 people have already contributed code to [Rails](https://github.com/rails/rails). Its easier than you think to become one of them. Not only is it free to use, you can also help make it better. More than 4,500 people have already contributed code to [Rails](https://github.com/rails/rails). Its easier than you think to become one of them.
## Famous websites use or used Ruby on Rails ## Famous websites use or used Ruby on Rails
Twitter was originally written in Ruby on Rails but moved away to a Java-based framework when needing to scale more. Twitch also heavily used Ruby and Ruby on Rails in the early stages but moved certain parts to Go-lang for anything that needed to be high-performant. Many websites that become famous and popular move parts or all of their back-end systems to frameworks based on compiled languages such Java, C++/C, and Go-lang from dynamic languages Ruby, Python, and Javascript (node). This is not always the case. Certain website are able to make dynamic language frameworks scale to as large as they need. Some good example are GitHub, Gitlab(open-source), Shopify, and Hulu. Twitter was originally written in Ruby on Rails but moved away to a Java-based framework when needing to scale more. Twitch also heavily used Ruby and Ruby on Rails in the early stages but moved certain parts to Go-lang for anything that needed to be high-performant. Many websites that become famous and popular move parts or all of their back-end systems to frameworks based on compiled languages such Java, C++/C, and Go-lang from dynamic languages Ruby, Python, and JavaScript (node). This is not always the case. Certain website are able to make dynamic language frameworks scale to as large as they need. Some good example are GitHub, Gitlab(open-source), Shopify, and Hulu.

View File

@ -19,7 +19,7 @@ A unit is often seen as the smallest piece of your code that can be accurately t
- **Fewer bugs** - Substantial research suggests that applying testing to an application can reduce production bug density by 40%80%. - **Fewer bugs** - Substantial research suggests that applying testing to an application can reduce production bug density by 40%80%.
- **Cost Reduction** - It's a very early phase in software testing so eventually it reduces cost of Testing as defects are captured in the early stage. - **Cost Reduction** - It's a very early phase in software testing so eventually it reduces cost of Testing as defects are captured in the early stage.
### Example(In Javascript) ### Example(In JavaScript)
Suppose there is a function written in file **add.js** Suppose there is a function written in file **add.js**
```javascript ```javascript
var add = function(number1, number2){ var add = function(number1, number2){

View File

@ -4,7 +4,7 @@ title: Any Type
# Any Type # Any Type
The Any type instructs Typescript to suspend type checking for the specified variables. Useful when working with dynamic content for which you don't know the type, and for transitioning your codebase from Javascript to Typescript in pieces. You can use Javascript's implicit typing with variables declared with a type of Any. The Any type instructs Typescript to suspend type checking for the specified variables. Useful when working with dynamic content for which you don't know the type, and for transitioning your codebase from JavaScript to Typescript in pieces. You can use JavaScript's implicit typing with variables declared with a type of Any.
Although the Any type can be helpful in specific circumstances, it should be used with caution, since it means we opt out of TypeScript's typechecking. Although the Any type can be helpful in specific circumstances, it should be used with caution, since it means we opt out of TypeScript's typechecking.

View File

@ -8,7 +8,7 @@ Speech recognition allows users affected by accessibility difficulties (such as
Speech synthesis provides websites the ability to provide information to users by reading the text. Speech synthesis provides websites the ability to provide information to users by reading the text.
## Javascript Web Speech API ## JavaScript Web Speech API
The [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API) enables you to incorporate voice data into web apps using both speech recognition and speech synthesis. The [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API) enables you to incorporate voice data into web apps using both speech recognition and speech synthesis.

View File

@ -5,7 +5,7 @@ title: Script Tag
The HTML Script tag is used to either contain client side JavaScript or reference an external JavaScript file using the script “src” attribute. The HTML Script tag is used to either contain client side JavaScript or reference an external JavaScript file using the script “src” attribute.
The `<script>` tag/element is used to incorporate client-side Javascript into your HTML file which can be used to add interactivity and logic to your website The `<script>` tag/element is used to incorporate client-side JavaScript into your HTML file which can be used to add interactivity and logic to your website
``` ```
<script> <script>
@ -15,10 +15,10 @@ The `<script>` tag/element is used to incorporate client-side Javascript into yo
<script src="js/app.js"> <script src="js/app.js">
``` ```
The tag can be used to encompass actual Javascript code right in the HTML itself like this The tag can be used to encompass actual JavaScript code right in the HTML itself like this
``` ```
<script> <script>
alert('hello this is my Javascript doing things!'); alert('hello this is my JavaScript doing things!');
</script> </script>
``` ```
@ -26,15 +26,15 @@ Or you can use it as a way to reference an external javascript file like this
``` ```
<script src="main.js" /> <script src="main.js" />
``` ```
Here the `src` attribute of the element takes in a path to a Javascript file Here the `src` attribute of the element takes in a path to a JavaScript file
Script tags are loaded into your HTML in-order and syncronously so it is usually best practice to add your scripts right before the ending of your `<body>` tag in your HTML like so Script tags are loaded into your HTML in-order and syncronously so it is usually best practice to add your scripts right before the ending of your `<body>` tag in your HTML like so
``` ```
<script src="main.js" /> <script src="main.js" />
<script> <script>
alert('hello this is my Javascript doing things!'); alert('hello this is my JavaScript doing things!');
</script> </script>
</body> </body>
``` ```
You can see the official documentation for the script element on the [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) You can see the official documentation for the script element on the [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)

View File

@ -50,7 +50,7 @@ Any `<a>` link can target the content of an `<iframe>` element. Rather than redi
This example will show a blank `<iframe>` initially, but when you click the link above it will redirect the `<iframe>` to show a YouTube video. This example will show a blank `<iframe>` initially, but when you click the link above it will redirect the `<iframe>` to show a YouTube video.
### Javascript and Iframes ### JavaScript and Iframes
Documents embedded in an `<iframe>` can run JavaScript within their own context (without affecting the parent webpage) as normal. Documents embedded in an `<iframe>` can run JavaScript within their own context (without affecting the parent webpage) as normal.
Any script interaction between the parent webpage and the content of the embedded `<iframe>` is subject to the same-origin policy. This means that if you load the content of the `<iframe>` from a different domain, the browser will block any attempt to access that content with JavaScript. Any script interaction between the parent webpage and the content of the embedded `<iframe>` is subject to the same-origin policy. This means that if you load the content of the `<iframe>` from a different domain, the browser will block any attempt to access that content with JavaScript.