Skip to content

Commit 63237fe

Browse files
committedDec 11, 2019
Converting .js file to .md to make it accessible by Docsify
1 parent 405cef6 commit 63237fe

25 files changed

+51
-22
lines changed
 

‎docs/JavaScript_Basics/BOM_functions.js renamed to ‎docs/JavaScript_Basics/BOM_functions.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
/* eslint-disable no-multi-spaces */
23
/* eslint-disable no-unused-vars */
34

@@ -122,4 +123,4 @@ const isIE = () => {
122123
const isIE11 = navigator.userAgent.indexOf(".NET CLR") > -1;
123124
const isIE11orLess = isIE11 || navigator.appVersion.indexOf("MSIE") !== -1;
124125
return isIE11orLess;
125-
};
126+
};```

‎docs/JavaScript_Basics/Datatypes.js renamed to ‎docs/JavaScript_Basics/Datatypes.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
var length = 16; // Number
23
var bigLength = BigInt(16) // BigInt
34
var lastName = "Johnson"; // String
@@ -8,3 +9,4 @@ var booleanValue = true; // Boolean
89
var newSymbol = Symbol("I'm new in es6!"); // Symbol
910

1011
// the type of every variable in javascript can be checked using typeof(var)
12+
```

‎docs/JavaScript_Basics/array_flat.js renamed to ‎docs/JavaScript_Basics/array_flat.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
const array = [];
23
array.flat(); // This is array flat method came new in ES-2019
34

@@ -20,4 +21,5 @@ console.log(arr1.flat()); // [1,2,3,'a', ['b','c']]
2021
console.log(arr1.flat(2)); // [1,2,3,'a', 'b','c']
2122

2223
// if you want to work on n level you need to pass Infinity
23-
console.log(arr1.flat(Infinity)); // [1,2,3,'a', 'b','c']
24+
console.log(arr1.flat(Infinity)); // [1,2,3,'a', 'b','c']
25+
```

‎docs/JavaScript_Basics/array_methods.js renamed to ‎docs/JavaScript_Basics/array_methods.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// 1. join() method
23
const sayings = ["India", "is", "my", "country"];
34
sayings.join(" - ");
@@ -229,4 +230,4 @@ console.log(numbers); //[2,4,6,8,10]
229230
console.log('The element removed after pop is: ', originalArray.pop());
230231
console.log('Array after pop is:');
231232
console.log(originalArray);
232-
}
233+
}```

‎docs/JavaScript_Basics/arrays.js renamed to ‎docs/JavaScript_Basics/arrays.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
````js
12
// Javascript arrays can take any values in the same array
23
// We don't have to specify the size
34
const a = ["hii", 26, "Swapnil"];
@@ -95,4 +96,4 @@ console.log(arrayCopy);
9596

9697
// Get a reverse copy of array
9798
const reverseArray = languages.reverse();
98-
console.log(reverseArray);
99+
console.log(reverseArray);````

‎docs/JavaScript_Basics/bitwise_operators.js renamed to ‎docs/JavaScript_Basics/bitwise_operators.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
console.log(5 & 13); // 0101 & 1101 = 0101
23
// expected output: 5;
34

@@ -42,4 +43,4 @@ var x = -5 >> 1; // outputs -3
4243

4344
/* JavaScript (Zero Fill) Right Shift (>>>)
4445
This is a zero fill right shift. One or more zero bits are pushed in from the left, and the rightmost bits fall off: */
45-
var x = 5 >>> 1; // outputs 2
46+
var x = 5 >>> 1; // outputs 2```

‎docs/JavaScript_Basics/boolean.js renamed to ‎docs/JavaScript_Basics/boolean.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// JavaScript Boolean data type can store one of two values, true or false. ... e.g.
23
const YES = new Boolean(true);
34

@@ -14,4 +15,4 @@ console.log(negativeVariable && positiveVariable) //Output: {false}
1415

1516
// JavaScript treats an empty string (""), 0, undefined and null as false.
1617

17-
// Everything else is true.
18+
// Everything else is true.```
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
```js
12
const obj = {
23
name: "Some name"
34
};
45

56
const name = null;
67

78
console.log(typeof obj); // object;
8-
console.log(typeof name); // object;
9+
console.log(typeof name); // object;```

‎docs/JavaScript_Basics/call.js renamed to ‎docs/JavaScript_Basics/call.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
const person = {
23
greetings: function () {
34
return `Hello, my name is ${this.name} and i'm ${this.age} years old`;
@@ -17,4 +18,4 @@ const person1 = {
1718

1819
const greeting = person.greetings.call(person1);
1920

20-
console.log(greeting);
21+
console.log(greeting);```

‎docs/JavaScript_Basics/comparison_operators.js renamed to ‎docs/JavaScript_Basics/comparison_operators.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
const comparisonOperators = () => {
23
console.log(1 !== 2); // inequality operator
34
console.log(1 != "1"); // inequality operator
@@ -15,4 +16,4 @@ const comparisonOperators = () => {
1516
console.log(3 <= 1); // less than or equal to
1617
};
1718

18-
comparisonOperators();
19+
comparisonOperators();```

‎docs/JavaScript_Basics/continue_break.js renamed to ‎docs/JavaScript_Basics/continue_break.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
/*
23
* Usage of continue and break
34
*/
@@ -60,4 +61,4 @@ firstFor: for (let i = 0; i < 5; i++) {
6061
result2.push(numbers.trim());
6162
}
6263
console.log(result2);
63-
// Will output: *'["0 1", "1 2", "2 3", "4 5"]'* with 'continue firstFor' and *'["0 1", "1 2", "2 3", "", "4 5"]'* with a simple continue statement.
64+
// Will output: *'["0 1", "1 2", "2 3", "4 5"]'* with 'continue firstFor' and *'["0 1", "1 2", "2 3", "", "4 5"]'* with a simple continue statement.```

‎docs/JavaScript_Basics/count_repeated_values.js renamed to ‎docs/JavaScript_Basics/count_repeated_values.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// You have array of repeated elements and you want to count repeated values
23

34
// lets take hashtags for example
@@ -8,4 +9,4 @@ console.log(allHashTags); // ['#ht1', '#ht2', '#ht3', '#ht1', '#ht2', '#ht1', '#
89
const hashtags = allHashTags.reduce((acum, cur) => Object.assign(acum, { [cur]: (acum[cur] | 0) + 1 }), {});
910

1011
// at the end you got object with unique hashtags with ther repeat values
11-
console.log(hashtags); // { '#ht1': 4, '#ht2': 2, '#ht3': 1 }
12+
console.log(hashtags); // { '#ht1': 4, '#ht2': 2, '#ht3': 1 }```

‎docs/JavaScript_Basics/date.js renamed to ‎docs/JavaScript_Basics/date.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// The Date object in JavaScript is used to work with dates and times.
23

34
// Current time
@@ -36,4 +37,4 @@ date.setFullYear(2020, 10, 3); // Set the date to November 3, 2020
3637

3738
date.setMonth(4); // Set the month to 4 (May)
3839

39-
date.setTime(1332403882588); // Thu Mar 22 2012 13:41:22 GMT+0530
40+
date.setTime(1332403882588); // Thu Mar 22 2012 13:41:22 GMT+0530```

‎docs/JavaScript_Basics/do_while_loop.js renamed to ‎docs/JavaScript_Basics/do_while_loop.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
```js
22
/* STRUCTURE:
33
do {
44
statement
@@ -15,4 +15,4 @@ let n = 1;
1515
do {
1616
console.log("n is less than 6. n = " + n);
1717
n++;
18-
} while (n < 6);
18+
} while (n < 6);```

‎docs/JavaScript_Basics/dom_manipulation.js renamed to ‎docs/JavaScript_Basics/dom_manipulation.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// Top most tree nodes
23
const html = document.documentElement; // The topmost document node.
34
const body = document.body; // To access body of the page. It can be null. That means it doen't exist.
@@ -129,4 +130,4 @@ singleDiv.style.color = 'blue';
129130
*/
130131

131132

132-
// See more at https://www.hongkiat.com/blog/dom-manipulation-javascript-methods/
133+
// See more at https://www.hongkiat.com/blog/dom-manipulation-javascript-methods/```

‎docs/JavaScript_Basics/filter.js renamed to ‎docs/JavaScript_Basics/filter.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// JavaScript Array filter() Method
23

34
/* The filter() method creates a new array with all elements that
@@ -22,4 +23,4 @@ function isBigEnough (value) {
2223
}
2324

2425
const filtered = [12, 5, 8, 130, 44].filter(isBigEnough);
25-
// filtered is [12, 130, 44]
26+
// filtered is [12, 130, 44]```

‎docs/JavaScript_Basics/filtering_array.js renamed to ‎docs/JavaScript_Basics/filtering_array.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
const animals = ["cats", "dogs", "bunnies", "birds"];
23

34
const start_with_b = animals.filter(name => name.indexOf("b") === 0);
@@ -17,4 +18,4 @@ function filter (array, callback) {
1718
function callback (num) {
1819
return Math.pow(num, 2);
1920
}
20-
console.log(filter(arr, callback));
21+
console.log(filter(arr, callback));```

‎docs/JavaScript_Basics/fs_module.js renamed to ‎docs/JavaScript_Basics/fs_module.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// Fs is a inbuilt function in nodejs to perform operations on files
23

34
// There are always two ways to do fs operation as sync and async
@@ -44,4 +45,4 @@ fsModule
4445
File ends
4546
*/
4647

47-
// This is a kind of publish , subscribe system our stream is subscriber and file is publisher we can use that using MQTT
48+
// This is a kind of publish , subscribe system our stream is subscriber and file is publisher we can use that using MQTT```

‎docs/JavaScript_Basics/functions.js renamed to ‎docs/JavaScript_Basics/functions.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// Functions in Javascript
23
// Functions are used to structure and generalize the code. It will become more flexible and you will have a better overview.
34

@@ -60,3 +61,4 @@ function add(a, b) { // in the "()" you define what variable names the inputs ge
6061
// Depending on the sequence, the values separated by a "," are assigned to the parameter variables.
6162
// a = 5; b = 8;
6263
result = add(5, 8) // result: 13
64+
```

‎docs/JavaScript_Basics/higher_order_functions.js renamed to ‎docs/JavaScript_Basics/higher_order_functions.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// HIGHER ORDER FUNCTIONS FOR ARRAYS
23

34
// the arrays in javascript have 3 main HOF
@@ -44,3 +45,4 @@ const newListFiltered = list.map(function (item, index, list) {
4445
[1, 10, 2, 21].sort();
4546

4647
// this return [1, 10, 2, 21]
48+
```

‎docs/JavaScript_Basics/if.js renamed to ‎docs/JavaScript_Basics/if.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// IF keyword condition
23
// this is used to create condition block of code
34

@@ -29,4 +30,4 @@ if (!condition) {
2930
// this code is executed because 1 is true like binary
3031
} else {
3132
// this block of code is never executed
32-
}
33+
}```

‎docs/JavaScript_Basics/iife.js renamed to ‎docs/JavaScript_Basics/iife.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
/*
23
IIFE: Immediately Invoked Function Expression or Anonymous functions
34
@@ -9,4 +10,4 @@ Can be used as shown below:--
910
(function (value) {
1011
const modified = value + 4;
1112
console.log(modified);
12-
}(3));
13+
}(3));```
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
```js
12
// Find substring in a string. Similar to contains in java.
23

34
// Defining dummy variables
45
var string = "foo", substring1 = "oo", substring2="a";
56

67
console.log(string.includes(substring1)); // true
78
console.log(string.includes(substring2)); // false
9+
```

‎docs/JavaScript_Basics/looping_an_object.js renamed to ‎docs/JavaScript_Basics/looping_an_object.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// Let's create a student object which contains their Roll. No and their names.
23
const studentObject = {
34
101: "Hitesh",
@@ -12,4 +13,4 @@ for (const key in studentObject) {
1213
if (key === 105) {
1314
console.log("The Student's name is ", studentObject[key]);
1415
}
15-
}
16+
}```

‎docs/JavaScript_Basics/map.js renamed to ‎docs/JavaScript_Basics/map.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
```js
12
// Let's create an array of numbers that we want to get the square of each number in the array
23
const numbers = [1, 2, 3, 4, 5];
34

@@ -13,4 +14,4 @@ console.log(square);
1314
// expected output: Array [1, 4, 9, 16, 25]
1415

1516
console.log(square2);
16-
// expected output: Array [1, 4, 9, 16, 25]
17+
// expected output: Array [1, 4, 9, 16, 25]```

0 commit comments

Comments
 (0)
Please sign in to comment.