Posts

insightsoftware vue js

CSS 1. Specificity What is CSS specificity? It’s the priority system CSS uses when multiple rules target the same element. Higher specificity wins. Order (low → high): Element selectors ( div , p , span ) → 0,0,1 Class / attribute / pseudo-class ( .btn , [type="text"] , :hover ) → 0,1,0 ID selectors ( #main ) → 1,0,0 Inline style ( style="color:red" ) → 1,0,0,0 (highest among normal) !important overrides normal specificity (but try to avoid it). Example: p { color: blue; } /* element */ .text { color: green; } /* class */ #intro { color: red; } /* id */ For <p id="intro" class="text">Hello</p> → color will be red . 2. How to show scroll: overflow-y: auto vs scroll overflow-y: auto Shows vertical scrollbar only when content is taller than container. Cleaner UI (no scrollbar if not needed). .container { max-height: 200px; overflow-y: auto; } overflow-y: scroll Scrollbar is...

Gspann Interview react

 What is Memory leaks, how do we avoid.

Apexon React.js Interview

1. What are features developed in your career 2. What are the custom components and have you created any. 3. Find the largest difference between numbers from a numeric array. const numberArray = [5, 12, 4, 8, 3, 9]; Without any in built method: Approach I: const largestDiff = (arr) => {     let result;     let maxItem;     let minItem;     for(let i = 0; i < numberArray.length; i++){         maxItem = numberArray[0]         minItem = numberArray[0]         for(let j = 0; j < numberArray.length; j++){             if(maxItem < numberArray[j]){                 maxItem = numberArray[j]             }else if(minItem < numberArray[j]){                 minItem = minItem             }else{       ...

TCS vue js

 1st round 1. Shallow vs deep copy 2.  string reverse input 'js' output 'sj' 3. Arrow function uses 4. foreach vs map 5. virtual DOM  2nd round 1. Vuex vs pinina 2. inject provide 3. inject provide vs store management 4. center an element  5..classA, .classB what it will do 6. .classA .classB what it will do 7. let a =[10],b b=a a.push[3] console.log(a,b) 8. sum(a,b) , sum(a,b,c) how function will received those arguments 9. rest vs spread 10. object de structuring 11. compare object in js 12. remove duplicate in array 13. how will you delete an data in object 14. event bubbling        1. Shallow Copy vs Deep Copy Shallow Copy : Creates a new object but copies only the references to nested objects. Changes made to nested objects in the copied object affect the original. Used with methods like   Object.assign()   or spread operator   {...obj }   in JavaScript. let original = { a: 1, b: { c: 2 } }; let shallowCopy = {...original ...

Global logic vuejs

 1. Composable context 2. using asyn composables 3. computed property uses and how it is different from methods 4. how to handle reactivity in vue3 5. vue directive 6. vue directive hooks 7. how do you handle a single root component  8. SFC and uses   1. Composable Context In Vue 3,   composables   are reusable functions that encapsulate reactive state and logic, allowing you to share behavior across components without mixins or higher-order components. The "composable context" refers to the environment within these functions, where you access reactive refs, computed properties, and lifecycle hooks using the Composition API. For example: import { ref, onMounted } from 'vue'; export function useCounter() { const count = ref(0); function increment() { count.value++; } onMounted(() => { console.log('Composable mounted'); }); return { count, increment }; } This function can be reused in multiple components, creating a shared "compos...

Wipro React.js Developer L1 Interview

1. What is Virtual DOM 2. React Hooks, How to handle lifecycle methods in useEffect 2. Second largest element in an array [11, 42, 85, 33, 22, 34]. 3. Output of below code      function outer(){     console.log(a); // o/p     var a = 10;     function inner(){         a++;         console.log(a) // o/p     }     inner() } const res = outer() 4. When to use state, context and redux for an application 5. ES6 Features 6. Call, Apply & Bind 7. Output of below code const numbers = [1, 2, 3, 4, 5, 6]; const sumOfEvens = numbers.reduce((acc, curr) => {   if (curr % 2 === 0) {     return acc + curr;   }   return acc;  }, 0); 8. Closure & Hoisting

CES Vue and ReactJS

CES Vue and ReactJS   📌 1. Vue.js Lifecycle Hooks Vue provides various lifecycle hooks that allow you to add code at specific stages of a component's life: ✅ beforeCreate – Runs after instance initialization, before data observation and events setup. ✅ created – Runs after data observation and events are set up. API calls and data initialization are often done here. ✅ beforeMount – Called before mounting begins, i.e., before the DOM is rendered. ✅ mounted – Called after the component is mounted to the DOM. You can access the DOM elements here. ✅ beforeUpdate – Called before the DOM updates when reactive data changes. ✅ updated – Called after the DOM has been updated. Use with caution to avoid infinite loops. ✅ beforeUnmount (Vue 3) – Called before a component is unmounted. ✅ unmounted (Vue 3) – Called after a component is removed from the DOM. 🔗 Example usage: export default { data() { return { message: "Hello" }; }, created() { console....