From 9b42d0f42ca93a3b9252ca001298361e250dfa9a Mon Sep 17 00:00:00 2001 From: Isaac Shoebottom Date: Wed, 5 Oct 2022 09:22:11 -0300 Subject: [PATCH] Create expr.js --- labs/L08/expr.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 labs/L08/expr.js diff --git a/labs/L08/expr.js b/labs/L08/expr.js new file mode 100644 index 0000000..019745c --- /dev/null +++ b/labs/L08/expr.js @@ -0,0 +1,18 @@ +//(string-append "Hello\n" "world!") +console.log("Hello\n" + "world!") +//(* (+ 1 2 3) 7) +console.log((1 + 2 + 3) * 7) +//(< 41 (* 6 7)) +console.log(41 < (6 *7)) +//(equal? (* (+ 1 2 3) 7) 42) +console.log(((1 + 2 + 3) * 7) === 42) +//(equal? "Spongebob" "Squarepants") +console.log("Spongebob" === "Squarepants") +//(and (equal? (* 6 7) 42) (equal? "Spongebob" "Squarepants")) +console.log(((6 * 7) === 42) && ("Spongebob" === "Squarepants")) +//(equal? 42 (if (< 3 5) (* 6 7) "turnip")) +console.log(42 === ((3 < 5)? (6 * 7): "turnip")) +// (or #t (/ 1 0)) +console.log(true || (1/0)) +// (and #f (/ 1 0)) +console.log(false && (1/0)) \ No newline at end of file