CIS 119 Chapter 2

Objectives

  • Add basic JavaScript code to a web page
  • Write JavaScript comments
  • Implement JavaScript solutions following syntax rules
  • Implement JavaScript solutions following style conventions
  • Create and use valid JavaScript identifiers
  • Write output directly to the web page
  • Write output to the console
  • Write output to popup dialogs
  • Get input from a popup dialog
  • Create and use variables
  • Create working JavaScript expressions to solve problems
  • Convert strings to numbers

Online notes for the week

Chapter 2 outline

  • Including JavaScript
  • JavaScript syntax
  • JavaScript style
  • statements
  • comments
  • identifiers
  • using objects, methods, amd properties
  • using document.write, document.writeln
  • using the alert, prompt, confirm dialogs
  • using console.log
  • primitive data types: numeric, string, Boolean
  • numeric expressions
  • variables
  • parseInt, parseFloat