Mindmap
Web development
Inhalt der Mindmap
Web development
learn javascript
- variables
- var = camelCase
- names are formed like camelCase
- value assigned with =
- value can be changed
- printed out with console.log(name of the var)
- mixed with strings in console.log
- console.log("what time is it?", myTime) and var is printed after question
- string interpolation
- We can use the + operator from earlier to interpolate (insert) a variable into a string, like this: var myPet = 'armadillo'; console.log('I own a pet ' + myPet + '.'); // Output: 'I own a pet armadillo.'
- data type
- string
- number
- boolean
- console
- console.log()
- math operators *+/-
- modulus
- 13%5=3 remainder
- random generation
- Math.random() * the max number you want, limit, could be decimal without Math.floor() capsulating it, rounds it to closest number
- modulus
- comments
- single line //
- multiple lines /* */
- Control Flow
- if/else Statements
- var needCoffee = true; if (needCoffee) { console.log('Finding coffee'); } else { console.log('Keep on keeping on!'); }
- () sadrzi uvijet
- Comparison Operators
- Less than: < Greater than: > Less than or equal to: <= Greater than or equal to: >=
- they will always return a boolean (true or false).
- to check if two things equal each other, we can use ===
- To check if two things do not equal each other, we can write !==
- else if Statements
- We can add more conditions to our if/else statement with: else if
- The whole thing ends with the singular else
- if (stopLight === 'red') { console.log('Stop'); } else if (stopLight === 'yellow') { console.log('Slow down'); } else if (stopLight === 'green') { console.log('Go!'); } else { console.log('Caution, unknown!'); }
- The whole thing ends with the singular else
- We can add more conditions to our if/else statement with: else if
- if/else Statements
- variables
Informationen
- Beschreibung
- Mindmap am Web development, erstellt von luckyone525 . am 15/08/2017.
- Erstellt von
- luckyone525 .
- Aufrufe
- 2
- Bewertung