Skip to main content

Posts

Showing posts from July, 2023

CSS styling concept and material

  CSS units Units in css use to set the distance/width/height or you can say Size of the elements. There are two types of units 1) Absolute 2) Relative 1) Absolute: a) Pixels remember 96px  = 1 Inch = 2.54 cm  e.g we use css property of font-size to set size of font. font-size :10px; 2) Relative: We say relative size mean every element size depend on it parent element size. What does it mean? Mean inner element size must be relative to parent element size. if i say inner div width must be 25% than it will accupy the 25% width relative to parent element width size. Might be parent div is itself 50% in width of its parent element. Relative units are not fixed in sizes. Relative units: %, em and rem What is em unit? em unit are use to apply on font-size of typography. em font-size occupy font-size relative to its parent div. What does it mean ? I have two divs div1 and div2. div2 is inner div of div1. div1 have 16px of font-size and div2 will get same font-size if we define ...

Loop is javascript

 references https://www.decodingweb.dev/fix-map-is-not-a-function-error-in-javascript#:~:text=Whenever%20you%20encounter%20a%20%22map,log(data)%20.&text=Before%20making%20any%20change%20to,need%20an%20array%20inside%20it! https://dev.to/ramonak/javascript-how-to-access-the-return-value-of-a-promise-object-1bck https://bobbyhadz.com/blog/javascript-map-is-not-a-function

Javascript concepts

Q1:  What is hoisting ? Variables and methods are hoisted in js which mean their declaration goes on top of the code mean when you console.log the value of variable before it initialize with any data ,it show its undefined value. var a; console.log(a) //undefine a = 12; console.log(a) // 12 console.log(b) // you will get an error b is not defind. Q3:What are data-types ? There are to type of data in js 1 ) primitive number, string, boolean, null, undefined are primitive data types.   2) References References => (), [], {} Definition in urdu: Asi koe bhi value jisko copy krne pr real copy nhi hota. Blke os mein value ka reference pass ho jata hai, ose hum reference value bolte hain. Or jiska copy krne pr real copy ho jae wo primtive value hoti hai. Let say we have an array let a = [1,2,3]; let b = a; when you pop value from array 'a' than the value also not exist in array 'b' bcz 'b' are taking/using/having array/data of array 'a' a.pop(); console.log(...