Skip to content

Commit ae4196a

Browse files
committedDec 11, 2019
Converting .js file to .md to make it accessible by Docsify
1 parent 3ba47d8 commit ae4196a

16 files changed

+32
-14
lines changed
 

‎docs/JavaScript_Advance/AJAX_request.js renamed to ‎docs/JavaScript_Advance/AJAX_request.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
const POST = "POST";
23

34
export class AJAXRequest {
@@ -26,4 +27,4 @@ export const open = (method, url, async) => {
2627
usedMethod = method;
2728
request.open(method, url, async);
2829
};
29-
export const send = string => (usedMethod === POST ? request.send(string) : request.send());
30+
export const send = string => (usedMethod === POST ? request.send(string) : request.send());```

‎docs/JavaScript_Advance/arrow_function.js renamed to ‎docs/JavaScript_Advance/arrow_function.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
let a = () => {
23
// This is arrow function came new in ES6
34
//It assigns the function to variable a as the identifier with let instead and adds arrows before the curly braces.
@@ -80,3 +81,4 @@ setTimeout(function () {
8081
setTimeout(() => {
8182
console.log("hello world");
8283
}, 0); //arrow functions provide better readability
84+
```

‎docs/JavaScript_Advance/assignments_arithmetic.js renamed to ‎docs/JavaScript_Advance/assignments_arithmetic.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
/* In javascript there are always several ways to the goal.
23
Also the syntax of variable assignment can be abbreviated.
34
This is particularly suitable for mathematic operators
@@ -111,4 +112,4 @@ y = 5 ** 2; // y: 25
111112

112113
// Shortcut
113114
y = 5;
114-
y **= 2; // y: 25
115+
y **= 2; // y: 25```

‎docs/JavaScript_Advance/assignments_bitwise.js renamed to ‎docs/JavaScript_Advance/assignments_bitwise.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
/* In javascript there are always several ways to the goal.
23
Also the syntax of variable assignment can be abbreviated.
34
This is also suitable for bitwise operations
@@ -86,4 +87,4 @@ y ^= x; // y: 0101 (binary)
8687

8788
// Basic
8889
y = 5; // y: 00000000000000000000000000000101 (binary)
89-
y = ~y; // y: 11111111111111111111111111111010 (binary) -6 (decimal)
90+
y = ~y; // y: 11111111111111111111111111111010 (binary) -6 (decimal)```

‎docs/JavaScript_Advance/async_await.js renamed to ‎docs/JavaScript_Advance/async_await.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// Async Await Flow on JavaScript
23

34
// the most common case to use async await is to handle promises for fetch request
@@ -39,3 +40,4 @@ const getUsers = async () => {
3940
console.log('DISPLAY AN ERROR', error)
4041
}
4142
}
43+
```

‎docs/JavaScript_Advance/bind.js renamed to ‎docs/JavaScript_Advance/bind.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
/* The bind() method creates a new function that, when called, has its this keyword set
23
to the provided value, with a given sequence of arguments preceding any provided
34
when the new function is called.
@@ -15,4 +16,4 @@ console.log(unboundGetX()); // The function gets invoked at the global scope
1516

1617
const boundGetX = unboundGetX.bind(module);
1718
console.log(boundGetX());
18-
// expected output: 42
19+
// expected output: 42```

‎docs/JavaScript_Advance/caesar_cipher.js renamed to ‎docs/JavaScript_Advance/caesar_cipher.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
/**
23
* Most simplest encryption scheme. Read more: [http://practicalcryptography.com/ciphers/caesar-cipher/]
34
**/
@@ -43,4 +44,4 @@ function caesarCipher (toEncipher, shift = 0) {
4344
return output;
4445
}
4546

46-
module.exports = caesarCipher;
47+
module.exports = caesarCipher;```

‎docs/JavaScript_Advance/callback.js renamed to ‎docs/JavaScript_Advance/callback.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
/**
23
* Callback functions are derived from a programming paradigm called
34
* `functional programming`. This basically can be concluded to this sentence:
@@ -150,4 +151,4 @@ axios({
150151
* instead of using callback functions. This approach also have pros and cons. One of
151152
* the cons of this approach, is instead of nested `.then()` blocks, you are going to
152153
* need nested `try` `catch` blocks. Sometimes this kind of problems are inevitable.
153-
*/
154+
*/```

‎docs/JavaScript_Advance/classes.js renamed to ‎docs/JavaScript_Advance/classes.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
class Student {
23
// onlyname; // This should not have let or const only in classes
34
constructor (name, age) { // name and age are arguments given to object at the time of creation of object
@@ -25,4 +26,4 @@ class StudentInfo {
2526
}
2627

2728
const SwapnilInfo = new StudentInfo("Swapnil Bio");
28-
SwapnilInfo.getNameAndCollege();
29+
SwapnilInfo.getNameAndCollege();```

‎docs/JavaScript_Advance/closures.js renamed to ‎docs/JavaScript_Advance/closures.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
/*
23
A closure is the combination of a function bundled together (enclosed)
34
with references to its surrounding state (the lexical environment).
@@ -27,4 +28,4 @@ explains closures
2728
*/
2829

2930
console.log(modifier());
30-
// [out] Original String: --->sample string, Modified String: ---> sample string is modified
31+
// [out] Original String: --->sample string, Modified String: ---> sample string is modified```

‎docs/JavaScript_Advance/connect_to_mongo.js renamed to ‎docs/JavaScript_Advance/connect_to_mongo.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
const mongo = require("mongoose");
23

34
// protocol hostname port database
@@ -18,4 +19,4 @@ mongo.connection.on("error", (err) => {
1819
// this code will also be executed once the script fails to connect to the mongodb.
1920
console.error("---> Error handling option two: An error occurred. Please have a look at the stacktrace beyond.");
2021
console.error(err);
21-
});
22+
});```

‎docs/JavaScript_Advance/cookies.js renamed to ‎docs/JavaScript_Advance/cookies.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// #1 Simple usage of cookies
23
document.cookie = "movie=Jungle Book";
34
document.cookie = "actor=Balu";
@@ -39,4 +40,4 @@ if (document.cookie.split(";").filter(function (item) {
3940
// ES2016
4041
if (document.cookie.split(";").filter((item) => item.includes("actor=Balu")).length) {
4142
console.log("The cookie \"actor\" has \"Balu\" for value (ES6)");
42-
}
43+
}```

‎docs/JavaScript_Advance/default_values.js renamed to ‎docs/JavaScript_Advance/default_values.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
/*
23
A JavaScript function can have default parameter value.
34
Using default function parameters, you can initialize parameters with default values.
@@ -26,4 +27,4 @@ const addOneToANumberAsDefault = (number1 = 1, number2 = number1 + 8) => {
2627
console.log(number2);
2728
};
2829

29-
addOneToANumberAsDefault(); // Output 9
30+
addOneToANumberAsDefault(); // Output 9```

‎docs/JavaScript_Advance/destructuring.js renamed to ‎docs/JavaScript_Advance/destructuring.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// As data coming from the server is very big then there is better way of getting the data out of object
23

34
const a = { // Suppose this is the object coming from server then
@@ -29,4 +30,4 @@ newArray = ["Swapnil", 19, "Shinde"]; // New array
2930

3031
const [firstName, , lastName] = newArray; // Destructured the firstName and lastName
3132

32-
console.log(`My name is ${firstName} ${lastName}`);// Output My name is Swapnil Shinde
33+
console.log(`My name is ${firstName} ${lastName}`);// Output My name is Swapnil Shinde```

‎docs/JavaScript_Advance/express.js renamed to ‎docs/JavaScript_Advance/express.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
const express = require("express");
23

34
const port = 3003;
@@ -11,4 +12,4 @@ routes.get("/system_info", (req, res) => {
1112

1213
app.use(express.json());
1314
app.use(routes);
14-
app.listen(port, () => console.log(`Server running in port ${port}`));
15+
app.listen(port, () => console.log(`Server running in port ${port}`));```

‎docs/JavaScript_Advance/function_as_object.js renamed to ‎docs/JavaScript_Advance/function_as_object.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
/*
23
Functions are special type of objects that has key-value pairs along with some code which gets executed
34
*/
@@ -11,4 +12,4 @@ returnName.hiddenObj = {
1112
};
1213

1314
console.log(returnName("hello")); // hello
14-
console.log(returnName.hiddenObj); // { name : 'i am a javascript object' }
15+
console.log(returnName.hiddenObj); // { name : 'i am a javascript object' }```

0 commit comments

Comments
 (0)
Please sign in to comment.