1.1 What Is JavaScript Flashcards
What Is JavaScript?
JavaScript (or simply JS) is the programming language of the web browser.
What is client-side programming?
the code runs on the client’s computer or device
What is server-side programming?
code is executed on a server and not on the user’s computer.
What does DOM stand for?
Document Object Model
The DOM, which stands for Document Object Model, is a programming interface for HTML.
What are functions?
functions are reusable pieces of code. Instead of writing the same code over and over again when you want to reuse it, you can put it inside a function and call the function where you need it.
What does the: alert() function do?
It’s predefined to open a pop-up in your browser.
()
Functions in JavaScript always have parentheses at the end, within which you can define custom parameters.
Click me!
onclick
onclick is a predefined HTML attribute.
Developer Tools Console
Option + Cmd + i
What happens:
alert(‘Hello world’);
pop-up with the text “Hello world”.
What happens:
console.log(‘Hello world’);
This function will print the given text to the console.
How do you clear the console screen?
“Cmd + L” or “Ctrl + L”.
Inline
“Inline JavaScript” means placing pieces of JavaSript directly into your HTML file, like this:
Click me!
Where should the tag go?
at the very bottom of the page, right before the closing body tag
Folder Structure:
simple-js-app:
css/ styles.css index.html js/ scripts.js