Question: JavaScript 9. a. Create a script that uses the Object constructor to create an object; assign the object to a variable student. Use the dot

JavaScript
9. a. Create a script that uses the Object constructor to create an object; assign the object to a variable student. Use the dot notation to populate the student object with the following properties and assign appropriate values: first name, surname, age, degree. Display the property value pairs of all properties using the dot notation. b. Create another script that uses the object literal approach to create a Student object. Again populate the object with the following properties and assign appropriate values: first name, surname, age, degree. Display the property value pairs of all properties using the square bracket notation. c. Create another script that re-factors ex9b to utilize the Constructor Pattern' to create a Student object (refer to the lecture notes 2a). The constructor should have 4 parameters 'fn', 'sn', 'a','d'. Create 4 properties in the constructor (representing the first name, surname, age, degree) and assign the appropriate parameters to them. Add another property 'displayStudent' and assign it the value displayStudent. Now declare a function displayStudent (outside the constructor function) that displays the property value pairs of the first 4 object properties. Next create an object of this Student type, passing 4 argument literals, and use the object instance to call displayStudent(). 9. a. Create a script that uses the Object constructor to create an object; assign the object to a variable student. Use the dot notation to populate the student object with the following properties and assign appropriate values: first name, surname, age, degree. Display the property value pairs of all properties using the dot notation. b. Create another script that uses the object literal approach to create a Student object. Again populate the object with the following properties and assign appropriate values: first name, surname, age, degree. Display the property value pairs of all properties using the square bracket notation. c. Create another script that re-factors ex9b to utilize the Constructor Pattern' to create a Student object (refer to the lecture notes 2a). The constructor should have 4 parameters 'fn', 'sn', 'a','d'. Create 4 properties in the constructor (representing the first name, surname, age, degree) and assign the appropriate parameters to them. Add another property 'displayStudent' and assign it the value displayStudent. Now declare a function displayStudent (outside the constructor function) that displays the property value pairs of the first 4 object properties. Next create an object of this Student type, passing 4 argument literals, and use the object instance to call displayStudent()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
