// Let's get some practice writing a few objects for a new group of interns at a small business. // ==== Challenge 1: Writing Objects ==== // HR needs some information on the new interns put into a database. Given an id, email, first name, and gender. Create an object for each person in the company list: // 1, [email protected], Mitzi, F // 2, [email protected], Kennan, M // 3, [email protected], Keven, M // 4, [email protected], Gannie, M // 5, [email protected], Antonietta, F // Example format of an intern object: 1, [email protected], Example, F // Write your intern objects here: const internone = { id: 1, name: "Mitzi", email: "[email protected]", gender: "F" } const interntwo = { id: 2, name: "Kennan", email: "[email protected]", gender: "M" } const internthree = { id: 3, name:"Keven", email: "[email protected]", gender: "M" } const internfour = { id: 4, name: "Gannie", email: "[email protected]", gender: "M" } const internfive = { id: 5, name: "Antoniettaa", email: "[email protected]", gender: "F" } // ==== Challenge 2: Reading Object Data ==== // Once your objects are created, log out the following requests from HR into the console: // Mitzi's name console.log(internone.name); // Kennan's ID console.log(interntwo.id); // Keven's email console.log(internthree.email); // Gannie's name console.log(internfour.name); // Antonietta's Gender console.log(internfive.gender); // ==== Challenge 3: Object Methods ==== // Give Kennan the ability to say "Hello, my name is Kennan!" Use the console.log provided as a hint. // console.log(kennan.speak()); internone.speak = function() {return "Hello, my name is Kennan!"} console.log(internone.speak()); // Antonietta loves math, give her the ability to multiply two numbers together and return the product. Use the console.log provided as a hint. //console.log(antonietta.multiplyNums(3,4)); console.log("antonietta" + " multiplies (var1*var2)"); // === Great work! === Head over to the the arrays.js. You may come back and attempt the Stretch Challenge once you have completed the challenges in arrays.js and function-conversion.js. // ==== Stretch Challenge: Nested Objects and the this keyword ==== // 1. Create a parent object with properties for name and age. Make the name Susan and the age 70. // 2. Nest a child object in the parent object with name and age as well. The name will be George and the age will be 50. // 3. Nest a grandchild object in the child object with properties for name and age. The name will be Sam and the age will be 30 // 4. Give each of the objects the ability to speak their names using the this keyword. const parent = {} // Log the parent object's name // Log the child's age // Log the name and age of the grandchild // Have the parent speak // Have the child speak // Have the grandchild speak