- Session - 1 : 1:30 hrs
- Tea Break : 20 mins
- Session - 2 : 1:40 hrs
- Lunch Break : 1 hr
- Session - 3 : 1:30 hrs
- Tea Break : 20 mins
- Session - 4 : 1:40 hrs
- No powepoint
- Discuss & Code
- Better foundation in JS
- Course Outline in repo
- Chrome Browser
- Any Editor (Visual Studio Code)
- Node.js
- To verify, run the following command in the command prompt / terminal
node --version
- To verify, run the following command in the command prompt / terminal
- Scripting Language
- Invented to make web pages interactive
- Client Side Validations
- Manipulate the UI
- Loosely typed language
- number
- string
- boolean
- object
- undefined
- default value of a variable when not initialized
- default return value of a function (when the function not returning anything explicitly)
- function
- var
- branching statements
- if...else
- switch...case
- loops
- do...while
- while
- for
- for...in
- break
- continue
- exceptions
- try...catch...finally
- throw
- Functions are first class citizens
- Functions can be treated like data
- functions can be assigned as values to variables
- Higher Order Functions
- functions can be passed as arguments to other functions
- functions can be returned as return values from other functions
- dictionaries
- collection of key/value pairs
- Traversing the DOM tree
var body = document.body;
var h1Ele = body.children[0];
console.log(h1Ele.innerText)
h1Ele.innerText = 'Welcome to DOM!'
- querying elements by id
var heading1 = document.getElementById('heading-1')
- querying elements by tag name
var paras = document.getElementsByTagName('p')
- querying elements by css class name
var highlightedElems = document.getElementsByClassName('highlight')
- querying elements by css selectors
var p = document.querySelector('body > div > p')
- innerText
- innerHTML
- value
- checked
- disabled
- parentElement
- appendChild()
- removeChild()
- getAttribute()
- createElement()
- insertAdjacentElement()
- classList.add()
- classList.remove()
- classList.contains()
- addEventListener()
- removeEventListener()
- required
- min
- max
- minLength
- maxLength
- An operation that will complete sometime in future and we dont wait for its completion
- callback
- promise
- An object used to communicate the result of an async operation
- async await
- generators
- observables
- Asynchronous JavaScript And XML
- JavaScript Object Notation
- String representation of a javascript object
- Easy to send across the wire
- use JSON.parse() for deserialization (string to object)
- use JSON.stringify() for serialization (object to string)
json-server (https://www.npmjs.com/package/json-server)
- Javascript utility server
- expose the data from a json file as REST endpoints
- also can act as web server
- to run the json-server:
npx json-server <data_file> [-p <port>]