We studied:
- 3 ways to add Javascript to your webpage
- Inline (using
onclick
attribute) - Internal (using
<script></script>
tag) - External (creating a new .js file and linking it using
<script src="relative/path/to/your.js"></script>
)
- Inline (using
- JS Statements
- JS Comments
alert('Hello World');
console.log('Hello World');
- JS functions
function funcName() {
/*
JS code
*/
}
- Chrome Dev Tools for JS
- Using
Console
tab to viewconsole.log()
- Using
Sources
tab to run JS step-by-step using breakpoints
- Using
You can read the following before Thursday class: