The 10 Days of JavaScript: Day 8 (Variable Scope & Context / this keyword)



Join the full course: https://www.udemy.com/learn-javascript-full-stack-from-scratch/?couponCode=10DAYSFULLCOURSE

Day 0: Intro https://www.youtube.com/watch?v=dc-2t26Vuhs
Day 1: Getting Started https://www.youtube.com/watch?v=K4b7LdWAVyw
Day 2: Functions https://www.youtube.com/watch?v=bYshPb-wEWs
Day 3: Objects https://www.youtube.com/watch?v=CXnnw9rQH5I
Day 4: Arrays https://www.youtube.com/watch?v=rTK0Gmf57jE
Day 5: Making Decisions https://www.youtube.com/watch?v=ZWxWx-vmubI
Day 6: Higher-Order Functions https://www.youtube.com/watch?v=25VUf6pUwEU
Day 7: Returning vs Mutating https://www.youtube.com/watch?v=eJ7hvnS0Bfk
Day 8: Scope & Context https://www.youtube.com/watch?v=WPcW83BMT3Y
Day 9: Misc. Must Know Info https://www.youtube.com/watch?v=AzxiDWeFeps
Day 10: Web Browser Practice https://www.youtube.com/watch?v=HQuJzGU7TWg
Day 11: Node.js and the Server https://www.youtube.com/watch?v=WTOnKNjiPWU

I’m using document.write() as a quick and dirty way to see/test values instead of always using console.log(). Please do as I say and not as I do 🙂 Do not use document.write() for anything beyond this simple testing case and outside of CodePen I’d say never use it. In future lessons we will learn far superior ways of adding HTML content to the page from JavaScript. Also, in the real world we would never want to repeatedly update the page for each item like this, it’s much better to use JavaScript to create one big string of HTML content (could concatenate to a string variable from within a while loop or forEach or even use array.reduce()) in memory first and then only add it to the page all at once. However, that’s getting into efficiency and web browser performance which are not topics I wanted to address this early in the course 🙂

Follow me for cat pics:
Instagram: https://www.instagram.com/learnwebcode/
Twitter: https://twitter.com/learnwebcode
Facebook: https://www.facebook.com/Brad-Schiff-1542576316048470/

source

סרטונים נוספים