console.log("Hello World!");
Hello World!
var speak = "Hello World";
console.log(speak);
Hello World
function logIt(output) {
    console.log(output);
}

logIt(speak);
Hello World
console.log("Welcome!")
logIt("Hello Students!");
logIt(2022)
Welcome!
Hello Students!
2022

Team Roles

// define a function to hold data for a Person
function Person(name, ghID, classOf) {
    this.name = name;
    this.ghID = ghID;
    this.classOf = classOf;
    this.role = "Scrum Master";
}

// define a setter for role in Person data
Person.prototype.setRole = function(role) {
    this.role = role;
}

// define a JSON conversion "method" associated with Person
Person.prototype.toJSON = function() {
    const obj = {name: this.name, ghID: this.ghID, classOf: this.classOf, role: this.role};
    const json = JSON.stringify(obj);  // json/string is useful when passing data on internet
    return json;
}

// make a new Person and assign to variable teacher
var scrummaster = new Person("Jazair Tallman", "@jz21324", 2024);  // object type is easy to work with in JavaScript
logIt(scrummaster);  // before role
logIt(scrummaster.toJSON());  // ok to do this even though role is not yet defined

// output of Object and JSON/string associated with Teacher
scrummaster.setRole("Scrum Master");   // set the role
logIt(scrummaster); 
logIt(scrummaster.toJSON());
Person {
  name: 'Jazair Tallman',
  ghID: '@jz21324',
  classOf: 2024,
  role: 'Scrum Master' }
{"name":"Jazair Tallman","ghID":"@jz21324","classOf":2024,"role":"Scrum Master"}
Person {
  name: 'Jazair Tallman',
  ghID: '@jz21324',
  classOf: 2024,
  role: 'Scrum Master' }
{"name":"Jazair Tallman","ghID":"@jz21324","classOf":2024,"role":"Scrum Master"}