repl.it
@MIhm7904/

ProblemSet6

Nodejs

Problem Set 6: Objects

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//Create an object with at least four key value pairs.  Your object can represent anything, a car, a person, a type of beer, etc.
//Access any attribute in your object and save it to a new variable.
//Overwrite any value in your object with a new value.

//1
const theOffice = {"boss" : "Michael", "secretary" : "Pam", "sales" : "Jim", "accountant" : "Oscar", "hr" : "Toby"}
console.log(theOffice)

//2
const leadSales = (theOffice["sales"])
console.log(leadSales)

//3
theOffice["sales"] = "Dwight"
console.log(theOffice)