You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An iterator is an object which defines a sequence and a return value upon its termination. It implements the Iterator protocol with a `.next()` method which returns an object with two properties:
Making objects, functions, classes or variables available to the outside world is as simple as exporting them, and then importing them where needed in other files.
7934
7934
@@ -7988,7 +7988,7 @@ export class Alligator {
7988
7988
7989
7989
<br/>
7990
7990
7991
-
## Q. Describe the Revealing Module Pattern in javascript?
7991
+
## Q 18.1. Describe the Revealing Module Pattern in javascript?
7992
7992
7993
7993
Revealing module pattern is a design pattern, which let you organise your javascript code in modules, and gives better code structure. It gives you power to create public/private variables/methods (using closure), and avoids polluting global scope
7994
7994
@@ -8035,7 +8035,7 @@ myModule._privateMethod(); // TypeError: protected by the module closure
8035
8035
<b><a href="#">↥ back to top</a></b>
8036
8036
</div>
8037
8037
8038
-
## Q. How do you detect javascript disabled in the page?
8038
+
## Q 18.2. How do you detect javascript disabled in the page?
8039
8039
8040
8040
You can use `<noscript>` tag to detect javascript disabled or not. The code block inside `<noscript>` get executed when JavaScript is disabled, and are typically used to display alternative content when the page generated in JavaScript.
8041
8041
@@ -8052,7 +8052,7 @@ You can use `<noscript>` tag to detect javascript disabled or not. The code bloc
8052
8052
<b><a href="#">↥ back to top</a></b>
8053
8053
</div>
8054
8054
8055
-
## Q. What is the difference between feature detection, feature inference, and using the UA string?
8055
+
## Q 18.3. What is the difference between feature detection, feature inference, and using the UA string?
8056
8056
8057
8057
**1. Feature Detection**
8058
8058
@@ -8088,7 +8088,7 @@ This is a browser-reported string that allows the network protocol peers to iden
8088
8088
<b><a href="#">↥ back to top</a></b>
8089
8089
</div>
8090
8090
8091
-
## Q. What is strict mode?
8091
+
## Q 18.4. What is strict mode?
8092
8092
8093
8093
The Strict Mode is allows you to place a program, or a function, in a `strict` operating context. This strict context prevents certain actions from being taken and throws more exceptions.
8094
8094
@@ -8116,7 +8116,7 @@ The Strict Mode is allows you to place a program, or a function, in a `strict` o
8116
8116
<b><a href="#">↥ back to top</a></b>
8117
8117
</div>
8118
8118
8119
-
## Q. Describe Singleton Pattern In JavaScript?
8119
+
## Q 18.5. Describe Singleton Pattern In JavaScript?
8120
8120
8121
8121
The **singleton pattern** is a type of creational pattern that restricts the instantiation of a class to a **single** object. This allows the class to create an instance of the class the first time it is instantiated; however, on the next try, the existing instance of the class is returned. No new instance is created.
## Q. What do you understand by ViewState and SessionState?
8171
+
## Q 18.6. What do you understand by ViewState and SessionState?
8172
8172
8173
8173
**1. Session State**:
8174
8174
@@ -8194,7 +8194,7 @@ On the other hand is information specific to particular web page. It is stored i
8194
8194
<b><a href="#">↥ back to top</a></b>
8195
8195
</div>
8196
8196
8197
-
## Q. Explain browser console logs features?
8197
+
## Q 18.7. Explain browser console logs features?
8198
8198
8199
8199
The `Console` method **log()** outputs a message to the web console. The message may be a single string or it may be any one or more JavaScript objects.
8200
8200
@@ -8237,7 +8237,7 @@ Output
8237
8237
<b><a href="#">↥ back to top</a></b>
8238
8238
</div>
8239
8239
8240
-
## Q. What are the difference between console.log() and console.dir()?
8240
+
## Q 18.8. What are the difference between console.log() and console.dir()?
8241
8241
8242
8242
* `console.log()` prints the element in an HTML-like tree
8243
8243
Output
@@ -8253,7 +8253,7 @@ Output
8253
8253
<b><a href="#">↥ back to top</a></b>
8254
8254
</div>
8255
8255
8256
-
## Q. How to Copy Text to Clipboard?
8256
+
## Q 18.9. How to Copy Text to Clipboard?
8257
8257
8258
8258
```html
8259
8259
<!-- The text field -->
@@ -8284,7 +8284,7 @@ function copy() {
8284
8284
<b><a href="#">↥ back to top</a></b>
8285
8285
</div>
8286
8286
8287
-
## Q. What is a service worker?
8287
+
## Q 18.10. What is a service worker?
8288
8288
8289
8289
A Service worker is basically a JavaScript file that runs in background, separate from a web page and provide features that don\'t need a web page or user interaction.
## Q. How do you manipulate DOM using service worker?
8373
+
## Q 18.11. How do you manipulate DOM using service worker?
8374
8374
8375
8375
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.
**Step 01: Create a Web Workers file**: Write a script to increment the count value.
8445
8445
@@ -8525,7 +8525,7 @@ w = undefined;
8525
8525
<b><a href="#">↥ back to top</a></b>
8526
8526
</div>
8527
8527
8528
-
## Q. What are the restrictions of web workers on DOM?
8528
+
## Q 18.13. What are the restrictions of web workers on DOM?
8529
8529
8530
8530
WebWorkers do not have access to below javascript objects since they are defined in an external files
8531
8531
@@ -8537,7 +8537,7 @@ WebWorkers do not have access to below javascript objects since they are defined
8537
8537
<b><a href="#">↥ back to top</a></b>
8538
8538
</div>
8539
8539
8540
-
## Q. What is rendering in JavaScript?
8540
+
## Q 18.14. What is rendering in JavaScript?
8541
8541
8542
8542
JavaScript-powered content needs to be rendered before it can output meaningful code and be displayed for the client.
8543
8543
These are the different steps involved in the JavaScript rendering process:
@@ -8633,7 +8633,7 @@ Painting can be global or incremental (similar to layout):
8633
8633
<b><a href="#">↥ back to top</a></b>
8634
8634
</div>
8635
8635
8636
-
## Q. What is the difference between HTMLCollection and NodeList?
8636
+
## Q 18.15. What is the difference between HTMLCollection and NodeList?
8637
8637
8638
8638
**HTMLCollection**
8639
8639
@@ -8685,7 +8685,7 @@ element.appendChild(text);
8685
8685
<b><a href="#">↥ back to top</a></b>
8686
8686
</div>
8687
8687
8688
-
## Q. What is a trampoline function? What is it used for?
8688
+
## Q 18.16. What is a trampoline function? What is it used for?
8689
8689
8690
8690
The trampoline is just a technique to optimize **recursion** and prevent `stack-overflow` exceptions in languages that don't support tail call optimization like Javascript ES5 implementation. However, ES6 will probably have support for tail call optimization.
8691
8691
@@ -8768,7 +8768,7 @@ Using a trampoline is obviously less performant than simple recursion, since you
8768
8768
<b><a href="#">↥ back to top</a></b>
8769
8769
</div>
8770
8770
8771
-
## Q. What is throttling and debouncing in javascript?
8771
+
## Q 18.17. What is throttling and debouncing in javascript?
8772
8772
8773
8773
Debouncing and throttling techniques are used to limit the number of times a function can execute. These are two widely-used techniques to improve the performance of code that gets executed repeatedly within a period of time.
The same-origin policy is a policy that prevents JavaScript from making requests across domain boundaries. An origin is defined as a combination of URI scheme, hostname, and port number. If you enable this policy then it prevents a malicious script on one page from obtaining access to sensitive data on another web page using Document Object Model(DOM).
8811
8811
8812
8812
<div align="right">
8813
8813
<b><a href="#">↥ back to top</a></b>
8814
8814
</div>
8815
8815
8816
-
## Q. What is server-sent events?
8816
+
## Q 18.19. What is server-sent events?
8817
8817
8818
8818
Server-sent events (SSE) is a server push technology enabling a browser to receive automatic updates from a server via HTTP connection without resorting to polling. These are a one way communications channel - events flow from server to client only. This is been used in Facebook/Twitter updates, stock price updates, news feeds etc.
8819
8819
@@ -8840,7 +8840,7 @@ Below are the list of events available for server sent events
8840
8840
<b><a href="#">↥ back to top</a></b>
8841
8841
</div>
8842
8842
8843
-
## Q. How do you get the image width and height using JS?
8843
+
## Q 18.20. How do you get the image width and height using JS?
8844
8844
8845
8845
You can programmatically get the image and check the dimensions(width and height) using Javascript.
0 commit comments