Programming/JavaScript (65) 썸네일형 리스트형 Linking a JavaScript File 밑에 코드블록을 전에 넣어줌 그럼 Chrome에서 실행했을 때 팝업창에 alert안에 넣은 string 문구도 뜨고 developer tool Console 열면 숫자 계산한 값도 뜬다. 근데 이렇게 코드 중간에 매번 script를 넣어줘야 하냐? 더 나은 방법이 있음! script.js 파일을 만들고 안에 코드를 옮긴다. 그리고 원래 코드가 있던 자리에는 source 파일명을 적어주면 됨 JavaScript Fundamentals – Part 1 실행 결과는?! 아까랑 똑같음 Hello World! Udemy에서 무려 69시간 짜리 JavaScript 강의를 결제했다 ^.ㅠ 야곰 iOS 캠프 수료하고 거의 1년 동안 프로그래밍에 손을 떼고 있었는데.... 테크니컬 라이터로 생존(?) & 배움의 욕구를 채우고자 자바스크립트를 공부할 계획이다. (거의 계속 자바스크립트 beginner 인강만 듣다 끝났는데... 이젠 intermediate로 level up하겠음!) 최종 목표는 내 손으로 docs 사이트를 만들어보는 것?!! (사실 그러려면 리액트를 배워야 하지만 기본기도 다질겸 자바스크립트 공부할 생각임) 강의 후기 보니까 어떤 사람이 이거 강의 다 듣는데 반년 걸렸다고 하는데 엌ㅋㅋㅋㅋ 포기하지 않을테다!!! 화이또 💪💪 Cmd + option + j -> open developer tool in .. Key Down Event Keydown Event Press a key on your keyboard 키보드 키 누르면 어떤 키가 눌렸는지 팝업창에 뜸! Window Resizing Resize the Window and Watch the Console 윈도우 사이즈를 조절하면 높이와 너비가 콘솔에 찍힘 Capturing Scroll Events Capturing Scroll Events 스크롤하면 콘솔에 pagetop이 찍힘 Mouseover, Mouseover Events: HTMLPreviousNext Roll your mouse over the box event(red 박스에 마우스 호버를 올리냐 나오느냐)에 따라서 텍스트 문구가 달라짐 = 각 이벤트에 따라 다르게 반응한다! Event.preventDefault() JavaScript Events Link to Google event.preventDefault();를 넣어주면 Link to Google를 클릭해도 google.com으로 가는 코드가 실행되지 않음 Event.preventDefault() - Web APIs | MDN The preventDefault() method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be. developer.mozilla.org Sequence selection loop var foods = ["Apple", "Coffee", "Rice", "Soup", "Coke"]; var myString = "I am really hungry for some"; for(var i=0; i While Loops var incrementor = 0; var text = ""; while( incrementor < 10 ){ text += `The incrementor has gone up to ${incrementor} \n`; incrementor++; } console.log(text); The incrementor has gone up to 0 The incrementor has gone up to 1 The incrementor has gone up to 2 The incrementor has gone up to 3 The incrementor has gone up to 4 The incrementor has gone up to 5 The incrementor has gone up to 6 The incr.. Difference Between == and === in JavaScript var myNum = 5; var otherNum = 6; var notNum = "5"; if(myNum == notNum){ console.log("true"); } else { console.log("false"); } myNum은 int이고 notNum은 string이지만 타입 변환(Type coercion)이 돼서 결국 myNum과 notNum이 같은 것으로 여겨짐 -> true값이 나옴 Type coercion is the automatic or implicit conversion of values from one data type to another (such as strings to numbers). https://developer.mozilla.org/en-US/docs/Glossary/.. 이전 1 ··· 3 4 5 6 7 다음