From a7cba0a31311067e52ffadae8e20b040e3772ef2 Mon Sep 17 00:00:00 2001 From: noephilip-restum Date: Mon, 14 Oct 2019 10:45:03 +0800 Subject: [PATCH 1/3] This is a commit message --- practice.js | 57 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/practice.js b/practice.js index 82a0b55..a9e07d3 100644 --- a/practice.js +++ b/practice.js @@ -15,6 +15,8 @@ */ //Code here +var me = { name: "Noe Philip Gabriel M. Restum", age: 20 }; +alert(me.name); ////////// PROBLEM 2 ////////// @@ -27,6 +29,14 @@ */ // Code here +var favoriteThings = { + band: "Linkin Park", + food: "Steak", + person: "Noelle Marie Angelica O. Quimson", + book: "Turtles all the way down", + movie: "Joker", + holiday: "Christmas Season" +}; /* After you've made your object, use bracket or dot notation to add another key named 'car' with the @@ -34,6 +44,8 @@ */ //Code here +favoriteThings.car = "Dodge Challenger"; +favoriteThings.brand = "Dodge"; /* Now use bracket or dot notation to change the value of the food key in your favoriteThings object to be 'Chicken Nuggets' @@ -41,6 +53,8 @@ */ //Code here +favoriteThings.food = "Chicken Nuggets"; +favoriteThings.book = "Harry Potter"; ////////// PROBLEM 3 ////////// @@ -53,6 +67,10 @@ */ //Code here +var backPack = {}; +var item = "firstPocket"; +backPack[item] = "chapstick"; +backPack.color = "Brown"; /* After you do the above, alert your entire backPack object. @@ -72,12 +90,12 @@ Instead, console.log your whole backPack object and then check out the console. // Do not edit the code below. var user2 = { - name: 'Aodhan', + name: "Aodhan", age: 28, - pwHash: 'U+Ldlngx2BYQk', - email: 'aodhan.hayter@gmail.com', - birthday: '11/03/1990', - username: 'aodhan.hayter', + pwHash: "U+Ldlngx2BYQk", + email: "aodhan.hayter@gmail.com", + birthday: "11/03/1990", + username: "aodhan.hayter" }; // Do not edit the code above. @@ -88,6 +106,8 @@ var user2 = { */ //Code Here +user2.name = "Aodhan Hayter"; +user2.email = "aodhan@boom.camp"; /////////////////////// EXTRA PRACTICE PROBLEMS BELOW //////////////////// ////////// MOVE ONTO NEXT SECTION BEFORE WORKING ON THESE //////////////// @@ -99,6 +119,7 @@ var user2 = { */ //Code Here +var methodCollection = {}; /* Now add two methods (functions that are properties on objects) to your methodCollection object. @@ -106,12 +127,22 @@ var user2 = { */ //Code Here +methodCollection = { + alertHello: function() { + alert("hello"); + }, + logHello: function() { + console.log("hello"); + } +}; /* Now call your alertHello and logHello methods. */ //Code Here +methodCollection.alertHello(); +methodCollection.logHello(); ////////// PROBLEM 6 ////////// @@ -121,6 +152,14 @@ var user2 = { */ //Code Here +function makePerson(name_n, birthday_n, ssn_n) { + var obj = { + name: name_n, + birthday: birthday_n, + ssn: ssn_n + }; + return obj; +} ////////// PROBLEM 7 ////////// @@ -130,3 +169,11 @@ var user2 = { */ //Code Here +function makeCard(cardNumber, expirationDate, securityCode) { + var obj = { + card_name: cardNumber, + expiration_date: expirationDate, + security_code: securityCode + }; + return obj; +} From 4f63980f59a73f57c908c5580cfbd2ab23701f77 Mon Sep 17 00:00:00 2001 From: noephilip-restum <55864659+noephilip-restum@users.noreply.github.com> Date: Mon, 14 Oct 2019 10:52:20 +0800 Subject: [PATCH 2/3] Update practice.js --- practice.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/practice.js b/practice.js index a9e07d3..f1777f6 100644 --- a/practice.js +++ b/practice.js @@ -77,6 +77,7 @@ backPack.color = "Brown"; */ //Code here +alert(backPack); /* You probably noticed that it just alerted [object Object]. @@ -85,6 +86,7 @@ Instead, console.log your whole backPack object and then check out the console. */ //Code here +console.log(backPack); ////////// PROBLEM 4 ////////// From 57a0c99a158e86856dc3bca44434adf666f17b21 Mon Sep 17 00:00:00 2001 From: noephilip-restum <55864659+noephilip-restum@users.noreply.github.com> Date: Mon, 14 Oct 2019 11:08:06 +0800 Subject: [PATCH 3/3] Update user.json --- user.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user.json b/user.json index 4ac80a0..0e73249 100644 --- a/user.json +++ b/user.json @@ -1,4 +1,4 @@ { - "name": "", - "email": "" + "name": "Noe Philip Gabriel M. Restum", + "email": "noe.restum@boom.camp" }