Skip to content

Commit 6a5e81c

Browse files
[auto] regenerate table of contents
1 parent e3a74ee commit 6a5e81c

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

README.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
| 14 | [What is a unary function](#what-is-a-unary-function) |
6565
| 15 | [What is the currying function](#what-is-the-currying-function) |
6666
| 16 | [What is a pure function](#what-is-a-pure-function) |
67-
| 17 | [Benefits](#benefits) |
67+
| 17 | [What are the benefits of pure functions](#what-are-the-benefits-of-pure-functions) |
6868
| 18 | [What is the purpose of the let keyword](#what-is-the-purpose-of-the-let-keyword) |
6969
| 19 | [What is the difference between let and var](#what-is-the-difference-between-let-and-var) |
7070
| 20 | [What is the reason to choose the name let as a keyword](#what-is-the-reason-to-choose-the-name-let-as-a-keyword) |
@@ -400,7 +400,7 @@
400400
| 350 | [What is the output of below console statement with unary operator](#what-is-the-output-of-below-console-statement-with-unary-operator) |
401401
| 351 | [Does javascript uses mixins](#does-javascript-uses-mixins) |
402402
| 352 | [Mixin Example using Object composition](#mixin-example-using-object-composition) |
403-
| 353 | [Benefits](#benefits-1) |
403+
| 353 | [Benefits](#benefits) |
404404
| 354 | [What is a thunk function](#what-is-a-thunk-function) |
405405
| 355 | [What are asynchronous thunks](#what-are-asynchronous-thunks) |
406406
| 356 | [What is the output of below function calls](#what-is-the-output-of-below-function-calls) |
@@ -973,7 +973,7 @@
973973
974974
**[⬆ Back to Top](#table-of-contents)**
975975
976-
9. ### What is the difference between == and === operators
976+
9. ### What is the difference between == and === operators
977977
JavaScript provides two types of equality operators:
978978
979979
- **Loose equality (`==`, `!=`)**: Performs type conversion if the types differ, comparing values after converting them to a common type.
@@ -1114,7 +1114,7 @@
11141114

11151115
**[⬆ Back to Top](#table-of-contents)**
11161116

1117-
7. ### What is the currying function
1117+
15. ### What is the currying function
11181118

11191119
**Currying** is the process of transforming a function with **multiple arguments** into a sequence of **nested functions**, each accepting **only one argument** at a time.
11201120

@@ -1325,7 +1325,7 @@
13251325
13261326
**[⬆ Back to Top](#table-of-contents)**
13271327
1328-
25. ### How do you decode or encode a URL in JavaScript?
1328+
24. ### How do you decode or encode a URL in JavaScript?
13291329
13301330
`encodeURI()` function is used to encode an URL. This function requires a URL string as a parameter and return that encoded string.
13311331
`decodeURI()` function is used to decode an URL. This function requires an encoded URL string as parameter and return that decoded string.
@@ -1340,7 +1340,7 @@
13401340
13411341
**[⬆ Back to Top](#table-of-contents)**
13421342
1343-
26. ### What is memoization
1343+
25. ### What is memoization
13441344
13451345
Memoization is a functional programming technique which attempts to increase a function’s performance by caching its previously computed results. Each time a memoized function is called, its parameters are used to index the cache. If the data is present, then it can be returned, without executing the entire function. Otherwise the function is executed and then the result is added to the cache.
13461346
Let's take an example of adding function with memoization,
@@ -1368,7 +1368,7 @@
13681368

13691369
**[⬆ Back to Top](#table-of-contents)**
13701370

1371-
27. ### What is Hoisting
1371+
26. ### What is Hoisting
13721372

13731373
Hoisting is a JavaScript mechanism where variables, function declarations and classes are moved to the top of their scope before code execution. Remember that JavaScript only hoists declarations, not initialisation.
13741374
Let's take a simple example of variable hoisting,
@@ -1400,7 +1400,7 @@
14001400

14011401
**[⬆ Back to Top](#table-of-contents)**
14021402

1403-
28. ### What are classes in ES6
1403+
27. ### What are classes in ES6
14041404

14051405
In ES6, Javascript classes are primarily syntactic sugar over JavaScript’s existing prototype-based inheritance.
14061406
For example, the prototype based inheritance written in function expression as below,
@@ -1433,7 +1433,7 @@
14331433

14341434
**[⬆ Back to Top](#table-of-contents)**
14351435

1436-
29. ### What are closures
1436+
28. ### What are closures
14371437

14381438
A closure is the combination of a function bundled(enclosed) together with its lexical environment within which that function was declared. i.e, It is an inner function that has access to the outer or enclosing function’s variables, functions and other data even after the outer function has finished its execution. The closure has three scope chains.
14391439

@@ -1459,13 +1459,13 @@
14591459

14601460
**[⬆ Back to Top](#table-of-contents)**
14611461

1462-
30. ### What are modules
1462+
29. ### What are modules
14631463

14641464
Modules refer to small units of independent, reusable code and also act as the foundation of many JavaScript design patterns. Most of the JavaScript modules export an object literal, a function, or a constructor
14651465

14661466
**[⬆ Back to Top](#table-of-contents)**
14671467

1468-
31. ### Why do you need modules
1468+
30. ### Why do you need modules
14691469

14701470
Below are the list of benefits using modules in javascript ecosystem
14711471

@@ -1475,37 +1475,37 @@
14751475

14761476
**[⬆ Back to Top](#table-of-contents)**
14771477

1478-
32. ### What is scope in javascript
1478+
31. ### What is scope in javascript
14791479

14801480
Scope is the accessibility of variables, functions, and objects in some particular part of your code during runtime. In other words, scope determines the visibility of variables and other resources in areas of your code.
14811481

14821482
**[⬆ Back to Top](#table-of-contents)**
14831483

1484-
33. ### What is a service worker
1484+
32. ### What is a service worker
14851485

14861486
A Service worker is basically a script (JavaScript file) that runs in the background, separate from a web page and provides features that don't need a web page or user interaction. Some of the major features of service workers are Rich offline experiences(offline first web application development), periodic background syncs, push notifications, intercept and handle network requests and programmatically managing a cache of responses.
14871487

14881488
**[⬆ Back to Top](#table-of-contents)**
14891489

1490-
34. ### How do you manipulate DOM using a service worker
1490+
33. ### How do you manipulate DOM using a service worker
14911491

14921492
Service worker can't access the DOM directly. But it can communicate with the pages it controls by responding to messages sent via the `postMessage` interface, and those pages can manipulate the DOM.
14931493

14941494
**[⬆ Back to Top](#table-of-contents)**
14951495

1496-
35. ### How do you reuse information across service worker restarts
1496+
34. ### How do you reuse information across service worker restarts
14971497

14981498
The problem with service worker is that it gets terminated when not in use, and restarted when it's next needed, so you cannot rely on global state within a service worker's `onfetch` and `onmessage` handlers. In this case, service workers will have access to IndexedDB API in order to persist and reuse across restarts.
14991499

15001500
**[⬆ Back to Top](#table-of-contents)**
15011501

1502-
36. ### What is IndexedDB
1502+
35. ### What is IndexedDB
15031503

15041504
IndexedDB is a low-level API for client-side storage of larger amounts of structured data, including files/blobs. This API uses indexes to enable high-performance searches of this data.
15051505

15061506
**[⬆ Back to Top](#table-of-contents)**
15071507

1508-
37. ### What is web storage
1508+
36. ### What is web storage
15091509

15101510
Web storage is an API that provides a mechanism by which browsers can store key/value pairs locally within the user's browser, in a much more intuitive fashion than using cookies. The web storage provides two mechanisms for storing data on the client.
15111511

@@ -1514,13 +1514,13 @@
15141514

15151515
**[⬆ Back to Top](#table-of-contents)**
15161516

1517-
38. ### What is a post message
1517+
37. ### What is a post message
15181518

15191519
Post message is a method that enables cross-origin communication between Window objects.(i.e, between a page and a pop-up that it spawned, or between a page and an iframe embedded within it). Generally, scripts on different pages are allowed to access each other if and only if the pages follow same-origin policy(i.e, pages share the same protocol, port number, and host).
15201520

15211521
**[⬆ Back to Top](#table-of-contents)**
15221522

1523-
39. ### What is a Cookie
1523+
38. ### What is a Cookie
15241524

15251525
A cookie is a piece of data that is stored on your computer to be accessed by your browser. Cookies are saved as key/value pairs.
15261526
For example, you can create a cookie named username as below,
@@ -1533,7 +1533,7 @@
15331533

15341534
**[⬆ Back to Top](#table-of-contents)**
15351535

1536-
40. ### Why do you need a Cookie
1536+
39. ### Why do you need a Cookie
15371537

15381538
Cookies are used to remember information about the user profile(such as username). It basically involves two steps,
15391539

@@ -1542,7 +1542,7 @@
15421542

15431543
**[⬆ Back to Top](#table-of-contents)**
15441544

1545-
41. ### What are the options in a cookie
1545+
40. ### What are the options in a cookie
15461546

15471547
There are few below options available for a cookie,
15481548

@@ -1560,7 +1560,7 @@
15601560

15611561
**[⬆ Back to Top](#table-of-contents)**
15621562

1563-
42. ### How do you delete a cookie
1563+
41. ### How do you delete a cookie
15641564

15651565
You can delete a cookie by setting the expiry date as a passed date. You don't need to specify a cookie value in this case.
15661566
For example, you can delete a username cookie in the current page as below.
@@ -1574,7 +1574,7 @@
15741574

15751575
**[⬆ Back to Top](#table-of-contents)**
15761576

1577-
43. ### What are the differences between cookie, local storage and session storage
1577+
42. ### What are the differences between cookie, local storage and session storage
15781578

15791579
Below are some of the differences between cookie, local storage and session storage,
15801580

@@ -1589,13 +1589,13 @@
15891589

15901590
**[⬆ Back to Top](#table-of-contents)**
15911591

1592-
44. ### What is the main difference between localStorage and sessionStorage
1592+
43. ### What is the main difference between localStorage and sessionStorage
15931593

15941594
LocalStorage is the same as SessionStorage but it persists the data even when the browser is closed and reopened(i.e it has no expiration time) whereas in sessionStorage data gets cleared when the page session ends.
15951595

15961596
**[⬆ Back to Top](#table-of-contents)**
15971597

1598-
45. ### How do you access web storage
1598+
44. ### How do you access web storage
15991599

16001600
The Window object implements the `WindowLocalStorage` and `WindowSessionStorage` objects which has `localStorage`(window.localStorage) and `sessionStorage`(window.sessionStorage) properties respectively. These properties create an instance of the Storage object, through which data items can be set, retrieved and removed for a specific domain and storage type (session or local).
16011601
For example, you can read and write on local storage objects as below
@@ -1607,7 +1607,7 @@
16071607

16081608
**[⬆ Back to Top](#table-of-contents)**
16091609

1610-
46. ### What are the methods available on session storage
1610+
45. ### What are the methods available on session storage
16111611

16121612
The session storage provided methods for reading, writing and clearing the session data
16131613

@@ -1627,7 +1627,7 @@
16271627

16281628
**[⬆ Back to Top](#table-of-contents)**
16291629

1630-
47. ### What is a storage event and its event handler
1630+
46. ### What is a storage event and its event handler
16311631

16321632
The StorageEvent is an event that fires when a storage area has been changed in the context of another document. Whereas onstorage property is an EventHandler for processing storage events.
16331633
The syntax would be as below
@@ -1654,13 +1654,13 @@
16541654

16551655
**[⬆ Back to Top](#table-of-contents)**
16561656

1657-
48. ### Why do you need web storage
1657+
47. ### Why do you need web storage
16581658

16591659
Web storage is more secure, and large amounts of data can be stored locally, without affecting website performance. Also, the information is never transferred to the server. Hence this is a more recommended approach than Cookies.
16601660

16611661
**[⬆ Back to Top](#table-of-contents)**
16621662

1663-
49. ### How do you check web storage browser support
1663+
48. ### How do you check web storage browser support
16641664

16651665
You need to check browser support for localStorage and sessionStorage before using web storage,
16661666

@@ -1674,7 +1674,7 @@
16741674

16751675
**[⬆ Back to Top](#table-of-contents)**
16761676

1677-
50. ### How do you check web workers browser support
1677+
49. ### How do you check web workers browser support
16781678

16791679
You need to check browser support for web workers before using it
16801680

@@ -1688,7 +1688,7 @@
16881688

16891689
**[⬆ Back to Top](#table-of-contents)**
16901690

1691-
51. ### Give an example of a web worker
1691+
50. ### Give an example of a web worker
16921692

16931693
You need to follow below steps to start using web workers for counting example
16941694

@@ -1739,7 +1739,7 @@
17391739

17401740
**[⬆ Back to Top](#table-of-contents)**
17411741

1742-
52. ### What are the restrictions of web workers on DOM
1742+
51. ### What are the restrictions of web workers on DOM
17431743

17441744
WebWorkers don't have access to below javascript objects since they are defined in an external files
17451745

0 commit comments

Comments
 (0)