Posts

interview 18-12

 /**      *     1    5s     ***    3    4s    *****    5   3s   *******   7   2s  *********  9   1s *********** 11  0s */ print star what is javascript javascript is async or synchronous promises callback async await

Moving Zeros

Image

4048

  $ npm i npm WARN cleanup Failed to remove some directories [ npm WARN cleanup   [ npm WARN cleanup     'C:\\Users\\atyagi581\\Desktop\\SelecfROMlIST\\celestial-ws\\node_modules\\react-scripts', npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\atyagi581\Desktop\SelecfROMlIST\celestial-ws\node_ modules\react-scripts\node_modules'] { npm WARN cleanup       errno: -4048, npm WARN cleanup       code: 'EPERM', npm WARN cleanup       syscall: 'rmdir', npm WARN cleanup       path: 'C:\\Users\\atyagi581\\Desktop\\SelecfROMlIST\\celestial-ws\\node_modules\\react-scripts\\node_mod ules' npm WARN cleanup     } npm WARN cleanup   ], npm WARN cleanup   [ npm WARN cleanup     'C:\\Users\\atyagi581\\Desktop\\SelecfROMlIST\\celestial-ws\\node_...
 let a = 20; let b=a; a=30; console.log(b); how to optimize an app how chunks of js files come if we modify only 1 out of 4, if those are cached before promise.all redux storybook code spliting

TO the new

 const arr= [1,2,3,2,3,4,5,6,6,1,3,2]; let output=arr.reduce((acc,curr)=>{   if(acc[curr]){     acc[curr]+=1;   }   else{     acc[curr]=1;   } return acc; },{}) console.log(output) // const arr =[1,2,3,4,5,6]; // const arrMap =(logic,arr)=>{ //   let output=[]; //   for(let i=0;i<=arr.length,i++){ //     let data= logic(arr[i]); //     output.push(data) //   } //   return output; // } // arrMap((element)=>{ //   element*2; // },arr) const  name='Ankit'.split(''); for(let i=name.length-1;i>=0;i--){   console.log(name[i]) }

Capgemini

  // var a= 1; // console.log(a); // var a = 2; // console.log(a); // let a= 1; // console.log(a); // let a= 2; // console.log(a); //call //apply //bind // var employee1 = { firstName: "John", lastName: "Rodson" }; // var employee2 = { firstName: "Jimmy", lastName: "Baily" };  // let invite = (greeting1, greeting2) => {  console.log(greeting1 + " " + this.firstName + " " + this.lastName + ", " + greeting2  );} // invite.call(employee1, "Hello", "How are you?"); // invite.call(employee2, "Hello", "How are you?"); const data =()=>{ console.log(this)     } data() //methods // function data(){ //     console.log(this) // } https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze Lifecycle method in react child to parent why closures iffi , hoisiting Promise.race vs promise.all vs async await https://www.geeksforgeeks.org/difference-betwee...
  exception handling const arr= [9,3,1,8,12]; /**  * find the missing Numbers without built in method  * output-->[2,4,5,6,7,10,11]  *   * Approach-->  * sort the Array [1,3,8,9,12]  * iterate and check for missingNumber  * push the missing number in a new Array */ const getSortedArr =(array)=>{   for(let i=array.length;i>0;i--){     let isSwapped ;     for(let j=0; j<i-1;j++){       if(array[j]>array[j+1]){       [array[j],array[j+1]]= [array[j+1],array[j]]        isSwapped= true;       }     }     if(!isSwapped){       break;     }   }   return array } /**  * @params number[]  * @function findMissingNumber  * return number[] */ const findMissingNumber=(arr)=>{   const sorted= new Set(getSortedArr(arr));   const getMaxLength=  [...sorted].pop(); ...