Home HTML Data Types DOM JavaScript JS Debugging Review Ticket

Hacks Create a JavaScript snippet below with the following requirements:
[X] Create an object representing yourself as a person. The object should have keys for your name, age, current classes, interests, and two more of your choosing\n”,

[X] Your object must contain keys whose values are arrays. The arrays can be arrays of strings, numbers, or even other objects if you would like\n”,

[X] Print the entire object with console.log after declaring it\n”,

[X] Manipulate the arrays within the object and print the entire object with console.log as well as the specific changed key afterwards\n”,

[X]Perform mathematical operations on fields in your object such as +, -, /, % etc. and print the results with console.log along with a message contextualizing them\n”,

[X] Use typeof to determine the types of at least 3 fields in your object”

%%js
let myself = {
    name: "saathvik",
    lastName: "Gampa",
    age: 14,
    carsOwned: 2,
    passions: ["Crypto", "School", "Music"],
    classesInOrder: ["Advanced Placement Calculus AB", "Advanced Placement Computer Science Principles", "Advanced Placement Chemistry", "Honors Humanities", "Spanish Six"]
}

console.log(myself);
// Deleting carsOwned Value
delete myself.carsOwned;
console.log(myself);
// Increasing value by one for age
myself.age++;
console.log(myself);

// Guessing Age
console.log("Choose a number between 1 and 9");
let numberGuessed = 3;
numberGuessed = numberGuessed * 2;
numberGuessed = numberGuessed + 5;
numberGuessed = numberGuessed * 50;
console.log("Did your birthday already occur this year? Answer with Y or N");
let birthdayThisYear = "N";
if (birthdayThisYear === "Y") {
    numberGuessed = numberGuessed + 1767;
} else {
    numberGuessed = numberGuessed + 1766;
}

console.log("What year were you born?");
let birthYear = 2008;
numberGuessed = numberGuessed - birthYear;
console.log(numberGuessed + " The first digit is the number you chose initially, and the last two digits is your birth year!");

// Typeof
console.log(typeof myself.name);  // Corrected this line
console.log(typeof myself.age);  // Corrected this line
console.log(typeof myself.passions);  // Corrected this line



<IPython.core.display.Javascript object>