Skip to content

Latest commit

 

History

History
51 lines (46 loc) · 1.79 KB

File metadata and controls

51 lines (46 loc) · 1.79 KB

Lecture Notes Week 2

Before class

Slack message students for things they'd like to review before diving into new topics

Reviewing (11-11:30am)

Cover individual topics that students may still be stuck on from previous lectures and homework

JSON (11:30am-12pm)

  • Illustration on Google Maps. How do people from Sweden speak to people from Sri Lanka?
  • Advice Slip and API. If they have machines that run on the programming language RUST, how can we communicate with them? They serialize their data to JSON!
  • Douglass Crawford
  • What is JSON?
    • Javscript Object Notation
    • We are fortunate that it's familiar and easy to understand :)
    • It is a STRING PokeAPI
    • Not all javascript objects are valid json
  • Coding exercise (lecture-exercise.js)
    • JSON.parse
  • Serialization vs Deserialization
    • JSON.stringify()
    • Other formats
      • protobufs
      • XML
      • GRPC?!
  • Cover homework question #3

Functions advanced (12-12:30pm)

  • Different ways functions can be made:
    • function declaration vs expression
    • arrow function
      • Omitting return, parameter parenthesis
  • What's a method?
  • Pure function? or side effects?
  • Example: how does a program run this? (example w/ a function, call of that function, and a console log)
    • Call stack (stack overflow)
  • Params
    • Extra params
    • Default params
  • Recursion (basic example)
  • Example function
    • pigs example?
    • countChar("kakkerlak", "k")? With DOM manipulation?
  • Simplicity of functions
  • Higher order functions
    • repeat(n, action)
    • greaterThan10

Array Manipulations

Map, Filter, Reduce (others? every, some, etc)