diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..6b2982b
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2020 JS snippets
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index 664295d..dcd01f3 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,59 @@
# JavaScript-snippets
-
-
-# JSsnippets on Facebook
-
-find us on [Facebook](https://www.facebook.com/snippetsJS)
-
-
-# How to generate a random number in a given range
-
+> Click :star: if you like the project. Pull Request are highly appreciated. Follow us on [Facebook](https://www.facebook.com/snippetsJS)
+
+### Table of Contents
+| No. | Questions |
+|---- | ---------
+|1 | [Generate a random number in a given range](#How-to-generate-a-random-number-in-a-given-range) |
+|2 | [Find the difference between two arrays](#How-to-find-the-difference-between-two-arrays)|
+|3 | [Convert truthy/falsy to boolean(true/false)](#Convert-truthy-falsy-to-boolean)|
+|4 | [Repeat a string](#Repeat-a-string)|
+|5 | [Check how long an operation takes](#Check-how-long-an-operation-takes)|
+|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)|
+|7 | [Did you know you can flat an array?](#Did-you-know-you-can-flat-an-array)|
+|8 | [Get unique values in an array](#Get-unique-values-in-an-array)|
+|9 | [Copy Text to Clipboard](#Copy-Text-to-Clipboard)|
+|10 | [Nested Destructuring](#Nested-Destructuring)|
+|11 | [URLSearchParams](#URLSearchParams)|
+|12 | [Count elements in an array](#Count-elements-in-an-array)|
+|13 | [Aliases with JavaScript Destructuring](#Aliases-with-JavaScript-Destructuring)|
+|14 | [The Object.is() method determines whether two values are the same value](#the-objectis-method-determines-whether-two-values-are-the-same-value)|
+|15 | [Freeze an object](#Freeze-an-object)|
+|16 | [Printing Object keys and values](#Printing-Object-keys-and-values)|
+|17 | [Capture the right click event](#Capture-the-right-click-event)|
+|18 | [In HTML5, you can tell the browser when to run your JavaScript code](#in-html5-you-can-tell-the-browser-when-to-run-your-javascript-code)|
+|19 | [Nullish coalescing operator](#Nullish-coalescing-operator)|
+|20 | [Optional chaining](#Optional-chaining)|
+|21 | [globalThis](#globalThis)|
+|22 | [The second argument of JSON.stringify lets you cherry-pick 🍒 keys to serialize.](#the-second-argument-of-jsonstringify-lets-you-cherry-pick--keys-to-serialize)|
+|23 | [Fire an event listener only once.](#Fire-an-event-listener-only-once)|
+|24 | [Vanilla JS toggle](#Vanilla-JS-toggle)|
+|25 | [Check if a string is a valid JSON](#Check-if-a-string-is-a-valid-JSON)|
+|26 | [getBoundingClientRect](#getBoundingClientRect)|
+|27 | [Check if a node is in the viewport](#Check-if-a-node-is-in-the-viewport)|
+|28 | [Notify when element size is changed](#Notify-when-element-size-is-changed)|
+|29 | [Detect if Browser Tab is in the view](#Detect-if-Browser-Tab-is-in-the-view)|
+|30 | [Private class methods and fields](#Private-class-methods-and-fields)|
+|31 | [Preventing paste into an input field](#Preventing-paste-into-an-input-field)|
+|32 | [The void operator](#The-void-operator)|
+|33 | [replaceAll](#replaceAll)|
+|34 | [Required Function Params](#Required-Function-Params)|
+|35 | [Get input value as a number](#Get-input-value-as-a-number)|
+|36 | [reduceRight](#reduceRight)|
+|37 | [Abort Fetch](#Abort-Fetch)|
+|38 | [How to change the value of an object which is inside an array](#How-to-change-the-value-of-an-object-which-is-inside-an-array)|
+|39 | [Numeric separators allow us to improve our code readability](#Numeric-separators-allow-us-to-improve-our-code-readability)|
+|40 | [pay attention when using every](#pay-attention-when-using-every)|
+|41 | [How to convert an array of key-value tuples into an object](#How-to-convert-an-array-of-key-value-tuples-into-an-object)|
+|42 | [Native text to speech JS](#Native-text-to-speech-JS)|
+|43 | [toFixed](#toFixed)|
+|44 | [generate randomUUID](#generate-random-uuid)|
+|45 | [structuredClone](#structuredClone)|
+|46 | [get device orientation](#get-device-orientation)|
+|47 | [CONST vs LET vs VAR](#const-let-var)|
+
+**[⬆ Back to Top](#table-of-contents)**
+### How to generate a random number in a given range
```javascript
// Returns a random number(float) between min (inclusive) and max (exclusive)
@@ -26,8 +72,8 @@ const getRandomNumberInclusive =(min, max)=> {
getRandomNumberInclusive(2, 10);
```
-# How to find the difference between two arrays.
-
+**[⬆ Back to Top](#table-of-contents)**
+### How to find the difference between two arrays
```javascript
const firstArr = [5, 2, 1];
@@ -66,7 +112,9 @@ difference(firstArr, secondArr); //[3,4]
console.log('difference',difference(firstArr, secondArr))
```
-# How to convert truthy/falsy to boolean(true/false)
+**[⬆ Back to Top](#table-of-contents)**
+### Convert truthy falsy to boolean
+
```javascript
const myVar = null;
const mySecondVar = 1;
@@ -78,8 +126,8 @@ console.log( !!myVar ) // false
console.log( Boolean(mySecondVar) ) // true
console.log( !!mySecondVar ) // true
```
-
-# How to repeat a string
+**[⬆ Back to Top](#table-of-contents)**
+### Repeat a string
```javascript
let aliens = '';
@@ -97,7 +145,8 @@ Array(6).join('👽')
//👽👽👽👽👽👽
```
-# Check how long an operation takes
+**[⬆ Back to Top](#table-of-contents)**
+### Check how long an operation takes
```javascript
//The performance.now() method returns a DOMHighResTimeStamp, measured in milliseconds.
//performance.now() is relative to page load and more precise in orders of magnitude.
@@ -110,7 +159,8 @@ const endTime = performance.now();
console.log("this doSomething took " + (endTime - startTime) + " milliseconds.");
```
-# Two ways to remove an item in a specific in an array
+**[⬆ Back to Top](#table-of-contents)**
+### Two ways to remove an item in a specific in an array
```javascript
//Mutating way
@@ -120,11 +170,12 @@ console.log(muatatedArray) //['a','b','d','e']
//Non-mutating way
const nonMuatatedArray = ['a','b','c','d','e'];
-const newArray = nonMuatatedArray.filter((item'index) => !( index === 2 ));
+const newArray = nonMuatatedArray.filter((item, index) => !( index === 2 ));
console.log(newArray) //['a','b','d','e']
```
-# Did you know you can flat an array?
+**[⬆ Back to Top](#table-of-contents)**
+### Did you know you can flat an array
```javascript
const myArray = [2, 3, [4, 5],[7,7, [8, 9, [1, 1]]]];
@@ -140,7 +191,8 @@ myArray.flat(infinity) // [2, 3, 4, 5 ,7,7, 8, 9, 1, 1];
```
-# Get unique values in an array
+**[⬆ Back to Top](#table-of-contents)**
+### Get unique values in an array
```javascript
const numbers = [1,1,3,2,5,3,4,7,7,7,8];
@@ -162,7 +214,9 @@ const unieqNumbers4 = _.uniq(numbers)
console.log(unieqNumbers4) //[1,3,2,5,4,7,8]
```
-# Copy Text to Clipboard
+
+**[⬆ Back to Top](#table-of-contents)**
+### Copy Text to Clipboard
```javascript
@@ -180,7 +234,8 @@ function copyToClipboard(){
```
-# Nested Destructuring
+**[⬆ Back to Top](#table-of-contents)**
+### Nested Destructuring
```javascript
@@ -197,7 +252,8 @@ const { education : { degree } } = user;
console.log(degree) //Masters
```
-# URLSearchParams
+**[⬆ Back to Top](#table-of-contents)**
+### URLSearchParams
```javascript
@@ -212,22 +268,8 @@ console.log(urlParams.toString()); // "?post=1234&action=edit"
console.log(urlParams.append('active', '1')); // "?post=1234&action=edit&active=1"
```
-
-# Shuffle an array
-
-
-```javascript
-const list = [1,2,3,4,5,6,7,8,9];
-const shuffle = list.sort(func);
-
-function func(a,b){
- return 0.5 - Math.random();
-}
-
-console.log(shuffle);
-```
-
-# Count elements in an array
+**[⬆ Back to Top](#table-of-contents)**
+### Count elements in an array
```javascript
@@ -252,8 +294,8 @@ const countMyFruits = myFruits.reduce((countFruits,fruit) => {
// { Apple:3, Banana:1, Mango:2, Orange:1 }
```
-
-# Aliases with JavaScript Destructuring
+**[⬆ Back to Top](#table-of-contents)**
+### Aliases with JavaScript Destructuring
```javascript
@@ -273,8 +315,8 @@ console.log(pageName) // JSsnippets
```
-
-# The Object.is() method determines whether two values are the same value
+**[⬆ Back to Top](#table-of-contents)**
+### The Object.is() method determines whether two values are the same value
```javascript
@@ -290,3 +332,676 @@ Object.is(foo, foo); // true
Object.is(foo, bar); // false
```
+
+
+**[⬆ Back to Top](#table-of-contents)**
+### Freeze an object
+
+
+```javascript
+const obj = {
+ name: "JSsnippets",
+ age:29,
+ address:{
+ street : 'JS'
+ }
+};
+
+const frozenObject = Object.freeze(obj);
+
+frozenObject.name = 'weLoveJS'; // Uncaught TypeError
+
+//Although, we still can change a property’s value if it’s an object:
+
+frozenObject.address.street = 'React'; // no error, new value is set
+
+
+delete frozenObject.name // Cannot delete property 'name' of #