learning-journal
Kyle's Learning Journal
Project maintained by AtkinsonKyle
Hosted on GitHub Pages — Theme by mattgraham
Javascript Notes
script
- When the browser comes across script, it stops to load the script then checks if it needs to do anyhting.
- script needs to be placed precisely where it needs to be!
Variables
var quantity;
- “var” is the variable keyword
- “quantity” is the variable name
- Cannot start with a number or contain - or .
Calling the Method of an Object
document.write('Wassa Dude!');
- “document” is the object and represents the entire webpage.
- ”.” is the member operator and accesses the memmbers of an object using a dot between the object name and member you want to access.
- “.write(‘Wassa Dude!’)” is the method and allows new to content to be written into the page where script element sits.
- “‘Wassa Dude!’” is the parameter and is a piece of information the method requires in order to work.
Data Types
- Numeric data types
- String data type
- consists of letters and other characters
- Boolean data type
- Can have one of two values, true or false