There are 3 ways to create a object in JavaScript 1.Using object literal We can user curly brances ({}) to create a object and define objects properties in curly brackets in key value pairs. let person = { firstName: ‘pravin’ , lastName: ‘khalase’} 2.By creating instance of Object Here, we can create object using new…
Month: November 2022
What is Event Bubbling
The event bubbling is method of event propagation, If there are nested elements and some events registered for those elements, if we trigger the child element event then it bubbles up to parent and hence its its parent event is also captured and this is called event propagation. First inner element(child) element is captured and…
Difference between slice and splice
Splice The splice() method returns the removed item(s) in an array The original array is affected Slice The slice() method returns the selected element(s) in an array, as a new array object The original array is not affected