CSCI 3342 Web Development
Fall 2024

JavaScript

Language Basics

Getting to know you in five minutes or less.
Use the interactive node console to explore the basics of the language. (Just type node in your shell to start it up.)

Prior class video

Pre-discussion of exercises (7:43)
Language questions to answer
  • How do you declare variables and constants in a dynamically-typed language
  • What happens when you re-assign variables and constants values of different types
  • How do you define string literals, and how do you display variable values in a string
  • Predict the results of these expressions, then try them out
    17 / 2
    17 // 2
    17 % 2
    17 / 0
    
    "15" + 3
    "15" - 3
    
    "bleeb" + 6
    "bleeb" - 6
    
    "5" == 5
    "5" === 5
    

Prior class video

Post-walkthrough of exercises (4:39)
Additional Reference: Fundamentals @ javascript.info
  • Lots of good coverage, see sections on variables, data types, conversions, operators, and comparisons
  • It assumes you're working in a browser, which isn't much different at this point.
  • Don't ever use alert, prompt, or confirm. Browsers modals are the devil. Use console.log like a decent person.

Assignment Checklist

Run the node interactive console and answer the questions above (nothing to turn in here)