Posts

Showing posts from December, 2022

JS Part3

1.  filter (concise):  const number = [1,2,3,3,4,4,5,6,7,8,9] const unique = number.filter((item,index)=>(number.indexOf(item)= = = index) ); filter will always return new array. It will not modify exixting array. isBiggerThanFive is the inline callback function  number.filter(isBiggerThanFive); function isBiggerThanFive(n){  return n>5; } In callback function we can test the conditions and return the callback. 2. map (ES6 --includes) We can use any type of key and values const myMap = new Map() // empty map object console.log(myMap) const key1 = 'mystr' const key2 = {} const key3 = function(){} string map values myMap.set(key1, 'this is a string'); myMap.set(key2, 'This is a blank object'); myMap.set(key3, 'this is empty function') console.log(myMap); // getting a values from map let value1 = myMap.get(key1); console.log(value1); //get the size of the map console.log(myMap.size); you can loop using for of to get keys and values for(let[key,value] ...

scrollTo top

< p (click) = "onDo($event)" style = " cursor:pointer" > < label style = " cursor:pointer" > back to top </ label > &nbsp;&nbsp; < i class = "fa fa-arrow-circle-up" aria-hidden = "true" ></ i > </ p > onDo(){  let scrollToTop = window.setInterval(() => {     let pos = window.pageYOffset;     if (pos > 0) {         window.scrollTo(0, pos - 20);      } else {         window.clearInterval(scrollToTop);     } }, 16);} } or < input type = "submit" (click) = "onDo($event)" style = " cursor:pointer " value = "GoToTop" >   onDo ( v : any ){     let scrollToTop = window . setInterval (() => {             let pos = window . pageYOffset ;               if ( pos > 0 ) {                 ...

basic review

<!-- afterLogIn == module creation [ ng generate module afterLogIn --routing --module=app ] beforeLogIn == module creation by using [ ng generate module beforeLogIn --routing --module=app ] service implementation by using [ ng g s provider/service ] component creation in beforeLogIn{header, footer,signUp,Login,landing, {faq,termCondition,support, privacyPolicy,aboutUs}} by using [ ng g c before-log-in/header ] implementation lazyLoading in app.route.module.ts by using this in routes array [{ path: 'before-log-in', loadChildren: () => import(`./before-log-in/ before-log-in.module`).then(m => m.BeforeLogInModule) },] component creation in afterLogIn{home{file,recent, photo,storage},MyProfile, settings,notification,[ upgrade,mainHeader,mainFooter, ]} remove declaration of these two from import array within app.module.ts [ // BeforeLogInModule, // AfterLogInModule, ] --> <!-- 1. npm install ngx-toastr --save 2. npm install @angular/animations --s...

Google search strategy

 w3 + modal fontawesome + bootstrap callback +[MDN]

Basic Git Strategy

 Pull & Push Command: git add . git commit -u "changes" git pull git push Create New Remote Instance: git init  git remote add origin repo_url create new branch: git branch branch_name cherryPick: to remove wrong commit and revert changes apply on other branch git rebase & git merge conflicts ----pending How to merge to branch? suppose there are two branch first one is production and the second is staging and you are working on staging branch  then  step 1: git branch staging  step2: git checkout staging  step3: git add . step4: git commit -m "update task list" step5: git checkout production  step6: git merge staging step7: git push -u origin master It's done another git command you can read about this be a good practice git log --oneline --all --graph git cherry-pic commit_id git push -u origin production note: here origin is the default remote instance.  git checkout -b branch_Name git revert id // to delete git branch git branch -d bran...

communication test -part 1

  Introduction Myself Rohit Raj Singh from Gorakhpur Uttar Pradesh, India. I have done B.Tech from computer science and engineering in 2018. I got 68% marks with first division. initially, I have worked as a java developer trainee at Infoseek private limited lucknow, as the part of Infoseek my responsibility to teach the students on the course of core java and advance java. after that I joined Mobiloitte private limited. with this organisation I have worked on multiple project some of them are listed in my CV. as a Angular front end developer my responsibility is HTML Integration, API integration, functionality Implementation ( aws s3 bucket image upload, bulk upload, bulk delete, save as draft, download csv, graph api integration etc.), 3rd party api integration and template modification as the requirements. creator dashboard is the most recent project. This is the admin panel of HiPi app. HiPi is the most popular app developed and maintained by zee entertainment media and glued...

callback()

 callback() : a callback() function is a function passed into another function as a argument which is then invoked inside the outer function to complete the specific routing or action. function greeting(name){ alert( hi, ${name} ); } function userInput(callback){ name= prompt('enter name'); callback(name); } userInput(greeting); This is a syschronous callback(). It’s executed immediately asynchronous means multiple executions are happening at the same time with different channel

Daily thought part 2

Image
 

part 4:

 call(): apply(): bind(): map(): reduce(): hoisting: closure():

Part 3: two discripency with JS data types

1. null data types. typesOf(null) //object 2. function data type does not exist in JS. tupesOf(function) // function Note :  1. All function in JS is actually property of an object. 2. object contains two types that is 1. array and 2. function 3. symbol data types is new in JS included with ES6. typeOf() will return the data types of variable. 4. JS array and function are also object data types. 5. Primitive data type refer to a single value in an address in memory. where as non-primitive data type refer to the address in memory which contains single or multiple key value pairs. Primitive and non-primitive data types :  there are 6 primitive and 1 non-primitive data type. total 7 are here - 1. number, string, boolean, null, undefined, symbol 2. object:-- contains 2: array, function Note: symbol data type is new in JS included with ES6. typeOf() will return the data types of variable. scene1:  var a=5; // when we create a variable it create a space for itself in the memory...

JS part 2:

 Day 1: filter() : filter() will always return new array. It will not modify existing array. isBiggerThanFive is the inline callback() function var number = [0,1,2,3,4,5,6,7,8,9]; console.log(number.filter(isBiggerThanFive)); function isBiggerThanFive(n){ return n>5 } In callback() function we can test the conditions and return to the callback() find(): used to filter an element using Id. when the element was not found find() will return the undefined. number.find(isBiggerThanFive); loop(): var n = [0,1,2,3,4,5,6,7,8,9] var filterArray=[];count = 0; for(var i=0;i<=n.length-1;i++){ let el = a[i]; if(el>5){ filterArray.push(a[i]); }else{ count += 1;} } findIndex(): we can get the element of index by using findIndex() method. number.findIndex(4) includes(): includes() will return true or false; true means value present in the array. number.includes(5); There are two common functionalities that is loadData() and showData() related to web development. loadData() can use window...