본문 바로가기

분류 전체보기67

JavaScript DOM event #Intro Events(Responding to user inputs and actions) It is a key to make interactive website doing anything in response to what user's doing. It reacts when users do such as clicks, drags, drops, hovers, scrolls etc. clicks/drags/drops/hovers/scrolls/ form submission/ key presses/ focus/ blur/ mouse whell/ double click/ copying/ pasting /audio start/ screen reszie/ printing etc # Inline event Th.. 2022. 12. 1.
JavaScript DOM # Intro DOM(Document Object Model) The DOM is a javascript representation of a webpage. It's your JS 'window' into the contents of a webpage. It's just a bunch of objects that you can interact with via JS. #Document Object The way works is when browsers load webpages and part of HTML and CSS and then creating Javascript object based on elements and those styles. They has a relationship that all .. 2022. 11. 17.
JavaScript new syntax # Default params It is optional to use parameter when you use a function. If you don't have any parameter to use, it will take defalut parameter. const rollDie(numSides){ return Math.floor(Math.random() * numSides) + 1 } rollDie(20) // It will retern random numbers between 1 and 20. 20 is a parameter. If you don't put any number in parentheses as a parameter, it will return 'NaN' because it is n.. 2022. 11. 12.
JavaScript Callback and Array Methods #forEach It accepts a callback function. It calls the function once per element in the array. This used more often before for..of was made. It allows run a function, run some code once per item in some array. So whatever function we pass in that function will be called once per item, where each item will be passed into the function automatically. const numbers = [1,2,3,4,5,6,7,8,9,10]; function .. 2022. 10. 25.