Posts

Showing posts from May, 2023

closure in javascript

 closure questions:-- function f1(){     var a=10;     function f2(){         console.log(a);     }     a=200;     return f2; } b=f1(); b(); ... function f1(b){     var a=4;     function f2(){         console.log(a,b);     }     return f2(); } f1(3); ........ function x(){     let i=1;     for(var i=1;i<=4;i++){         setTimeout(function(){             console.log(i);         },i*1000);     }     console.log("good morning"); } x(); function x(){     let i=1;     for(let i=1;i<=4;i++){         setTimeout(function(){             console.log(i);         },i*1000);     }     console.log("good morning"); } x(); ....................... ...

angular project

router outlet/:--- https://www.section.io/engineering-education/angular-11-routing/#:~:text=Router%2DOutlet%20is%20an%20Angular,%3E

html table

  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta http-equiv = "X-UA-Compatible" content = "IE=edge" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Document </ title > </ head > < body >     < table Border = "1px" >         < tr >             < th > rollno </ th >             < th > name </ th >             < th > course </ th >         </ tr >         < tr >             < td > 1 </ td >             < td > ankit </ td >             < td > react js <...

javascriptbasics

 1.https://www.geeksforgeeks.org/why-javascript-is-a-single-thread-language-that-can-be-non-blocking/

responsiveflexbox

css:--- * {      margin :  0px ;      padding :  0px ;      box-sizing :  border-box ; } .container {      margin :  auto ; /* width: 550px; */ height : 200px ; border : 2px   solid   red ; display :  flex ; flex-wrap :  wrap ; gap :  1em ; /* align-content: space-around; */ /* column-gap: 1em; row-gap: 1em; */ /* display: flex; flex-flow:row-reverse wrap; */ /* flex-wrap: wrap; */ /* align-items:stretch; */ /* justify-content: center; */ } .item1 {      flex :  1   0   200px ;      /* flex-grow: 3; */      height :  100px ;      /* width: 100px; */      background-color :  aqua ;    ...