|
65 | 65 | | 58 | [What are the different ways to convert a string to an integer](#58-what-are-the-different-ways-to-convert-a-string-to-an-integer) |
|
66 | 66 | | 59 | [How to find the operating system in the client machine using JavaScript](#59-how-to-find-the-operating-system-in-the-client-machine-using-javascript) |
|
67 | 67 | | 60 | [Name some JavaScript frameworks and libraries](#60-name-some-javascript-frameworks-and-libraries) |
|
| 68 | +| 61 | [What is event bubbling and event capturing](#61-what-is-event-bubbling-and-event-capturing) | |
| 69 | +| 62 | [What is the role of event.stopPropagation()](#62-what-is-the-role-of-eventstoppropagation) | |
68 | 70 |
|
69 | 71 | ### 1. What is JavaScript
|
70 | 72 | * JavaScript is a scripting language used to create dynamic and interactive websites. It is supported by all major web browsers.
|
@@ -937,17 +939,36 @@ console.log(+"10"); // output ========> 10
|
937 | 939 | Number("10"); // output ========> 10
|
938 | 940 | Number("abc"); // output ========> NaN
|
939 | 941 | ```
|
| 942 | +**[:top: Scroll to Top](#javascript-interview-questions)** |
940 | 943 |
|
941 | 944 | ### 59. How to find the operating system in the client machine using JavaScript
|
942 | 945 | We can use the **navigator.platform** property to find out the operating system of the client machine
|
943 | 946 | ```js
|
944 | 947 | console.log(navigator.platform); // output ========> 'Linux x86_64'
|
945 | 948 | ```
|
| 949 | +**[:top: Scroll to Top](#javascript-interview-questions)** |
946 | 950 |
|
947 | 951 | ### 60. Name some JavaScript frameworks and libraries
|
948 | 952 | **Frameworks** - Angular, Ember.js, Vue.js, Meteor, Next.js
|
| 953 | + |
949 | 954 | **Libraries** - React, Backbone.js
|
950 | 955 |
|
| 956 | +**[:top: Scroll to Top](#javascript-interview-questions)** |
| 957 | + |
| 958 | +### 61. What is event bubbling and event capturing |
| 959 | +Event bubbling and Event Capturing are two different mechanisms used for handling event propagation in the HTML DOM API. When an event is triggered on an element which is inside another element, and both elements have an event listener attached to them , the event propagation mode determines the order in which the elements receive the event. |
| 960 | + |
| 961 | +**Event Bubbling** - The event is first triggered on the innermost element and then propagated/bubbles up to its parent elements and eventually to the outermost element in the DOM hierarchy. |
| 962 | + |
| 963 | +**Event Capturing** - The event is first triggered on the outermost element and then propagated/bubbles down to its child elements and eventually to the innermost element in the DOM hierarchy. |
| 964 | + |
| 965 | +**[:top: Scroll to Top](#javascript-interview-questions)** |
| 966 | + |
| 967 | +### 62. What is the role of event.stopPropagation() |
| 968 | +This method is used to stop the event from propagating up or down the DOM hierarchy. |
| 969 | + |
| 970 | +**[:top: Scroll to Top](#javascript-interview-questions)** |
| 971 | + |
951 | 972 | ## Output Based Questions
|
952 | 973 |
|
953 | 974 | **1. What will be the output**
|
|
0 commit comments