Given the below object
CODE TEMPLATE
let user = {
age: 22,
hasVoted: false,
name: "vivek",
location: "India",
hobbies: ["dance", "music"],
};
console.log(user);
Task1 : Draw the Object Diagram for the above Object. Here is a sample Object Digram for your reference.
Task2 : Create a variable secondHobby
and write the code to store the second element of the hobbies array into it.
Task3 : Write the code to add a new property 'favouriteSubjects' to the object and add 'Maths', 'Physics' and 'Chemistry' as the values.
Task4 : Write the code to add a new hobby "swimming" to the hobbies array.