UNB/ CS/ David Bremner/ teaching/ cs2613/ labs/ Lab 8

Before the lab

Background


Questions

Time
15 minutes
Activity
Group discussion

Running JavaScript

Time
15 minutes
Activity
Demo

In a file

    console.log("Hello world");

Running a script

In a Browser

Note
Examples involving "prompt" and "alert" will only work in a browser.

In the REPL

Translating Racket expressions into Javascript

Time
15 minutes
Activity
Individual Work
    //(string-append "Hello\n" "world!")

    //(* (+ 1 2 3) 7)

    //(< 41 (* 6 7))

    //(equal? (* (+ 1 2 3) 7) 42)

    //(equal? "Spongebob" "Squarepants")

    //(and (equal? (* 6 7) 42) (equal? "Spongebob" "Squarepants"))

    //(equal? 42 (if (< 3 5) (* 6 7) "turnip"))

    // (or #t (/ 1 0))

    // (and #f (/ 1 0))

Quiz 1


Before Next Lab