From 891c733990c9d377d0a2e2cd3ef193df035ec1f3 Mon Sep 17 00:00:00 2001 From: Mahnoor Afteb Date: Sun, 31 Jan 2021 03:17:24 -0500 Subject: [PATCH] added week 2 assignment --- week-2/.DS_Store | Bin 6148 -> 6148 bytes week-2/jsforcats_mahnoor.log | 201 +++++++++++++++++++++++++++++++++++ week-2/week-2.log | 20 ---- 3 files changed, 201 insertions(+), 20 deletions(-) create mode 100644 week-2/jsforcats_mahnoor.log delete mode 100644 week-2/week-2.log diff --git a/week-2/.DS_Store b/week-2/.DS_Store index 2f2822ea8472eeb76d3e60dbade119e3536ddd77..5bce1ff196c81f30c95ff87e56c9c6bd921b2731 100644 GIT binary patch delta 109 zcmZoMXfc=&$z8;d%#g@X!cfc*Kk=cuHzNZBgD685kekMk&wwP!kPB3n!H@?O1&Ql1 j:4:1 +(anonymous) @ VM1330:4 +logANumber(0) +logANumber(1) +logANumber(2) +logANumber(3) +logANumber(4) +logANumber(5) +logANumber(6) +logANumber(7) +logANumber(8) +logANumber(9) +VM1330:2 0 +VM1330:2 1 +VM1330:2 2 +VM1330:2 3 +VM1330:2 4 +VM1330:2 5 +VM1330:2 6 +VM1330:2 7 +VM1330:2 8 +VM1330:2 9 +undefined +var zeroThroughTen = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] +undefined +var myCatFriends = ["bill", "tabby", "ceiling"] +undefined +console.log(myCatFriends[0]) +VM1590:1 bill +undefined +myCatFriends.push("super hip cat") +4 +myCatFriends +(4) ["bill", "tabby", "ceiling", "super hip cat"]0: "bill"1: "tabby"2: "ceiling"3: "super hip cat"length: 4__proto__: Array(0) +myCatFriends.length +4 +var myCatFriends = ["bill", "tabby", "ceiling"] +var lastNames = ["the cat", "cat", "cat"] +var addresses = ["The Alley", "Grandmas House", "Attic"] +undefined +var billsPosition = 0; +undefined +myCatFriends[billsPosition]; +"bill" +address[billsPosition]; +VM1870:1 Uncaught ReferenceError: address is not defined + at :1:1 +(anonymous) @ VM1870:1 +addresses[billsPosition] +"The Alley" +var firstCat = { name: "bill", lastName: "the cat", address: "The Alley" } +var secondCat = { name: "tabby", lastName: "cat", address: "Grandmas House" } +var thirdCat = { name: "ceiling", lastName: "cat", address: "Attic" } +undefined +console.log(firstCat.name) +VM2013:1 bill +undefined +console.log(firstCat.name, firstCat.address) +VM2201:1 bill The Alley +undefined +{ date: "10/20/2012", diary: "slept a bit today", name: "Charles" } +{date: "10/20/2012", diary: "slept a bit today", name: "Charles"} +console.log(date) +VM2264:1 Uncaught ReferenceError: date is not defined + at :1:13 +(anonymous) @ VM2264:1 +//array filled with objects +var moodLog = [ + { + date: "10/20/2012", + mood: "catnipped" + }, + { + date: "10/21/2012", + mood: "nonplussed" + }, + { + date: "10/22/2012", + mood: "purring" + } +] +undefined +//object filled with array +// ordered from least to most favorite +var favorites = { + treats: ["bird sighting", "belly rub", "catnip"], + napSpots: ["couch", "planter box", "human face"] +} +undefined +function measureLoopSpeed() { + var count = 0 + function addOne() { count = count + 1 } + + // Date.now() returns a big number representing the number of + // milliseconds that have elapsed since Jan 01 1970 + var now = Date.now() + + // Loop until Date.now() is 1000 milliseconds (1 second) or more into + // the future from when we started looping. On each loop, call addOne + while (Date.now() - now < 1000) addOne() + + // Finally it has been >= 1000ms, so let's print out our total count + console.log(count) +} + +measureLoopSpeed() +VM2384:14 8252046 +undefined +VM37:55 Uncaught SyntaxError: Unexpected identifier diff --git a/week-2/week-2.log b/week-2/week-2.log deleted file mode 100644 index d624f85..0000000 --- a/week-2/week-2.log +++ /dev/null @@ -1,20 +0,0 @@ -Navigated to https://github.uconn.edu/pages/maa17019/dmd-3475/ -console.log("Hi there!"); -VM388:1 Hi there! -undefined -console.warn("Hello Mahnoor"); - -VM427:1 Hello Mahnoor -(anonymous) @ VM427:1 -undefined -console.error("Hello Mahnoor"); - -VM480:1 Hello Mahnoor -(anonymous) @ VM480:1 -undefined -alert ("Hi Mahnoor 😉") -undefined -prompt ("Hi Mahnoor 😉"); -"heyyy" -confirm ("Are you single"); -true