❮ Index
❯
TOC: JavaScript Programming
- Introduction to JavaScript
- History of JavaScript
- About JavaScript
- JavaScript editors, IDEs
- alert
- Document.write
- confirm
- prompt
- console
- Separate script to its own file
- Comments in JavaScript
- Bad Comments in JavaScript
- Literal values in JavaScript (numbers, strings, booleans, etc.)
- Examples for generating Infinite and NaN (not a number)
- var - variables in JavaScript
- Variables without var
- use strict
- use strict + var
- Scope of variables
- Exercise: Set up environment for web browser
- Exercise: Set up environment for command line
- Exercise: Set up development environment
- Exercise: Hello World
- JavaScript basics
- Numerical Operators
- String operations
- String index and slice
- indexOf, lastIndexOf
- substr, slice, and substring
- Concatenate strings
- Replace substring
- Mixing numbers and strings
- Converting between numbers and strings
- Convert octal, hexa
- Converting decimal to hexa
- Browser IO (HTML)
- Browser IO (JavaScript)
- Exercise: Hello World on pressing button
- Solution: Hello World on pressing button
- Exercise: Add two numbers
- Solution: Add two numbers
- Variable definition
- Conditionals in JavaScript
- if statement
- Double equal (==) issues in JavaScript
- Compare values using == in JavaScript
- Compare values using === in JavaScript
- Comparision operators
- Comparision operators - examples
- Booleans: true and false
- Falsy values in JavaScript
- Truthy values in JavaScript
- Logical operators
- Toggle boolean
- Convert Truthy and Falsy values to boolean
- Short circuit
- if - else
- else if
- Switch (case) in JavaScript
- Math.round
- Rounding up a float to integer (ceil)
- Rounding down a float to integer (floor)
- Converting float to integer (trunc)
- Math.random
- Throw a dice (random integers 1-6)
- Exercise: Calculator
- Solution: Calculator
- Exercise: Guess number
- Solution: Guess number
- Arrays in JavaScript
- for-loop
- while loop
- Break out from while loop in JavaScript
- An infinite while loop
- Continue to next in while loop in JavaScript
- do-while loop in JavaScript
- new Array
- Literal array: []
- Enlarge array with elements
- JavaScript Arrays - pop - push
- JavaScript Arrays - shift - unshift
- Two dimensional array (matrix)
- For-in loop on array
- ForEach loop on array
- Reverse array
- Concatenate arrays
- Concatenate array with object
- Concatenate array is shallow
- Array indexOf lastIndexOf
- Array slice (range) or splice
- Split string, join array
- Deep copy with JSON
- Exercise: Count digits
- Solution: Count digits
- Exercise: Count characters
- Solution: Count characters
- Exercise: Number guessing - history
- Solution: Number guessing - history
- Exercise: Number guessing
- Exercise: Reverse the number guessing game
- Solution: Reverse the number guessing game
- JavaScript functions
- Function statements
- Function expressions (Anonymous functions)
- Unknown number of function arguments
- Assign function
- Passing functions as parameter of another function
- Recursive function
- Dispatch table
- Variable scope
- Scope in if block
- Variable in for loop
- Immediate Execution using ()
- Immediate Execution with parameters using ()
- Private Global Scope
- Exercise: Reverse Polish Calculator
- Reverse Polish Calculator in JavaScript
- Order
- JavaScript Objects
- new empty object
- new Objects
- new Object with attribute
- Literal Objects
- Dumping data structures (for debugging)
- Access JavaScript object attributes
- Change JavaScript object attributes
- Add JavaScript object attributes
- Delete property from object
- for-in loop on JavaScript object
- Count words
- Count words fixed
- keys of an object
- Advanced JavaScript
- Stringify NaN, Infinite, and null
- JSON parsing NaN, Infinite, and null
- JSON parsing NaN, Infinite, and null (Node.js)
- typeof
- typeof and null
- Delayed (scheduled) execution - setTimeout
- Recurring execution - setInterval
- Stop recurring execution - clearInterval
- Dates
- sort
- sort object
- sort datestrings
- map
- Closures in JavaScript
- Exception handling
- NodeJS: command line arguments
- NodeJS: prompt on STDIN
- Transliterate
- RegExp - Regular Expressions in JavaScript
- DOM - Document Object Model
- Other
- Application
- JavaScript Appendix