Google Maps: interaction, loading new data, and more
JavaScript Coding Fundamentals
Where does JS code go?
JS can be put anywhere in <head> or <body>
HTML elements may need to be loaded before executing your JS code, which is why JS is often put at the bottom of <body>
JavaScript Terminology
Objects (the nouns of JS): An object is a bundle of information that is packaged in an organized way. Nearly everything in JS is an object.
Properties (the adjectives of JS): Objects have properties, which tell you things about the object. You can get properties and sometimes you can change them. Written as Object.property
Methods (the verbs of JS): Methods are built-in actions that do various tasks. Written as methodName()
Functions: A collection of custom-written JS code that waits to be executed until called. Written as functionName()
Conceptual Examples
Object: Car
Object: Car.door
Object: Car.door.window
Property: Car.color (would return a value such as red)
Property: Car.door.open (would return true or false)