66|---- | ---------
77| 1 | [ Generate a random number in a given range] ( #How-to-generate-a-random-number-in-a-given-range ) |
88| 2 | [ Find the difference between two arrays] ( #How-to-find-the-difference-between-two-arrays ) |
9+ | 3 | [ Convert truthy/falsy to boolean(true/false)] ( #Convert_truthy/falsy_to_boolean(true/false) ) |
10+ | 4 | [ Repeat a string] ( #Repeat_a_string ) |
11+ | 5 | [ Check how long an operation takes] ( #Check_how_long_an_operation_takes ) |
12+ | 6 | [ Two ways to remove an item in a specific in an array] ( #Two_ways_to_remove_an_item_in_a_specific_in_an_array ) |
13+ | 7 | [ Did you know you can flat an array?] ( #Did_you_know_you_can_flat_an_array ) |
14+ | 8 | [ Get unique values in an array] ( #Get_unique_values_in_an_array ) |
15+ | 9 | [ Copy Text to Clipboard] ( #Copy_Text_to_Clipboard ) |
16+ | 10 | [ Nested Destructuring] ( #Nested_Destructuring ) |
17+
918
1019
1120** [ ⬆ Back to Top] ( #table-of-contents ) **
@@ -68,7 +77,8 @@ difference(firstArr, secondArr); //[3,4]
6877console .log (' difference' ,difference (firstArr, secondArr))
6978```
7079
71- # How to convert truthy/falsy to boolean(true/false)
80+ ** [ ⬆ Back to Top] ( #table-of-contents ) **
81+ ### Convert truthy/falsy to boolean(true/false)
7282``` javascript
7383const myVar = null ;
7484const mySecondVar = 1 ;
@@ -80,8 +90,8 @@ console.log( !!myVar ) // false
8090console .log ( Boolean (mySecondVar) ) // true
8191console .log ( !! mySecondVar ) // true
8292```
83-
84- # How to repeat a string
93+ ** [ ⬆ Back to Top ] ( #table-of-contents ) **
94+ ### Repeat a string
8595``` javascript
8696
8797let aliens = ' ' ;
@@ -99,7 +109,8 @@ Array(6).join('👽')
99109// 👽👽👽👽👽👽
100110
101111```
102- # Check how long an operation takes
112+ ** [ ⬆ Back to Top] ( #table-of-contents ) **
113+ ### Check how long an operation takes
103114``` javascript
104115// The performance.now() method returns a DOMHighResTimeStamp, measured in milliseconds.
105116// performance.now() is relative to page load and more precise in orders of magnitude.
@@ -112,7 +123,8 @@ const endTime = performance.now();
112123console .log (" this doSomething took " + (endTime - startTime) + " milliseconds." );
113124```
114125
115- # Two ways to remove an item in a specific in an array
126+ ** [ ⬆ Back to Top] ( #table-of-contents ) **
127+ ### Two ways to remove an item in a specific in an array
116128
117129``` javascript
118130// Mutating way
@@ -126,7 +138,8 @@ const newArray = nonMuatatedArray.filter((item, index) => !( index === 2 ));
126138console .log (newArray) // ['a','b','d','e']
127139```
128140
129- # Did you know you can flat an array?
141+ ** [ ⬆ Back to Top] ( #table-of-contents ) **
142+ ### Did you know you can flat an array
130143
131144``` javascript
132145const myArray = [2 , 3 , [4 , 5 ],[7 ,7 , [8 , 9 , [1 , 1 ]]]];
@@ -142,7 +155,8 @@ myArray.flat(infinity) // [2, 3, 4, 5 ,7,7, 8, 9, 1, 1];
142155
143156```
144157
145- # Get unique values in an array
158+ ** [ ⬆ Back to Top] ( #table-of-contents ) **
159+ ### Get unique values in an array
146160
147161``` javascript
148162const numbers = [1 ,1 ,3 ,2 ,5 ,3 ,4 ,7 ,7 ,7 ,8 ];
@@ -164,7 +178,9 @@ const unieqNumbers4 = _.uniq(numbers)
164178console .log (unieqNumbers4) // [1,3,2,5,4,7,8]
165179
166180```
167- # Copy Text to Clipboard
181+
182+ ** [ ⬆ Back to Top] ( #table-of-contents ) **
183+ ### Copy Text to Clipboard
168184
169185
170186``` javascript
@@ -182,7 +198,8 @@ function copyToClipboard(){
182198
183199```
184200
185- # Nested Destructuring
201+ ** [ ⬆ Back to Top] ( #table-of-contents ) **
202+ ### Nested Destructuring
186203
187204
188205``` javascript
0 commit comments