YPYash Patelinpatelyash.hashnode.dev·May 20, 2022 · 2 min readDifferent iteration statements in javascript1) for loop for loop will repeat until a specified condition met. for([initialExpression],[conditionExpression],[incrementExpression]) example const arr = [10,20,25,55,60,80,95]; let count = 0; for(let i=0; i < arr.length; i++){ if(arr[i] % 10 =...00
YPYash Patelinpatelyash.hashnode.dev·May 20, 2022 · 2 min readFrequently used array methods in JavaScript1) concat concat method will merge arrays and return a new array. example const arr1 = [1,2,3] const arr2 = [a,b,c] const ans = arr1.concat(arr2) console.log(ans) // [1,2,3,a,b,c] concat will return a shallow copy of an existing array concat can tak...00
YPYash Patelinpatelyash.hashnode.dev·May 20, 2022 · 3 min readEvent bubbling and capturing in JavaScript.Event bubbling and capturing are two ways of event propagation in the DOM tree. Event Bubbling In the bubbling, the event is "bubbled" up to the DOM tree. so from the targeted element to its parent elements and finally to the root. Let's check with ...00