Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 1.03 KB

javascript-notes.md

File metadata and controls

31 lines (27 loc) · 1.03 KB

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
    • handles numbers
  • String data type
    • consists of letters and other characters
  • Boolean data type
    • Can have one of two values, true or false