Mindmap
JavaScript
Inhalt der Mindmap
JavaScript
OUTPUT
- window.alert()
- Alert box
- document.getElementById(id)
- innerHTML- gets content
- id attribute in HTML- defines
- console.log()
- Use for debugging
- document.write()
- Dangerous!
- Only use when testing
- window.alert()
Begin by using <script> tags at the end of <body> in HTML
- Improves display speed
- Can src a .js file inside <script>
- External .js file good if use is for multiple webpages
ARRAYS
- Indexing is 0 based
- colors[1] =blue
- Arrays are objects
- var colors = [ 'red', 'blue', 'green'];
- Indexing is 0 based
FUNCTIONS
- Task executed when called
- Stops at return statement
- function name(p1, p2) { return task }
- vars defined inside are local
- Task executed when called
METHODS
- A property whos value is a function
- Helps working with different datatypes
- pop(), push(), length(), concat(), toString(), indexOf(), getDate()
- A property whos value is a function
DATATYPES & VARIABLES
- Datatypes: undefined, null, boolean, string, number, object
- typeof- finds datatype
- Declare variables: var, let, const
- Assign variables: =
- No assignment = undefined
- var number = 27;
- Can perform mathematics
- var string = "word";
- "" = ' '
- Can concatenate together
- var person = {Name : 'Jack'}
- Setting a value to null has type object
- booleans =true/false
- Datatypes: undefined, null, boolean, string, number, object
OBJECTS
- Variable with many values
- var face = { eyeColor: 'blue' , shape: 'oval'}
- Named values are Properties
- access using obName.propName
- Functions stored as properties are Methods
- access using obName.methName( )
- this -refers to object
- Named values are Properties
EVENTS
- HTML event attributes with JS
- <element event='JS'>
- eg. <button onclick= 'JS'>
- Often call functions
Informationen
- Beschreibung
- Software Developer Coding (Front End Development) Mindmap am JavaScript, erstellt von Tara Curran am 03/06/2019.
- Erstellt von
- Tara Curran
- Aufrufe
- 3
- Bewertung