JS Assignment 11: Intro to Objects
Hi everyone,
I am not sure what to do in ex:1 and specifically this line "This variable should be assigned a new object".
malvoliothegood (274)
Yes, you need to say what ex. 1 is asking.
Here is a page on Objects. It may be helpful to you: https://www.w3schools.com/js/js_objects.asp
skudeva (21)
@malvoliothegood Thank you!
The link you provided doesn't work for other people. Can you paste the code into a regular repl instead?
@Vandesm14
Would that help?
function exerciseOne(){
// Exercise One: In this exercise you will create a variable called 'aboutMe'
// This variable should be assigned a new object
// In this object create three key:value pairs
// The keys should be: 'name', 'city', 'favoriteAnimal'
// The values should be strings associated with the keys.
// return the variable 'aboutMe'
}
let aboutMe = [];
let about ={
name:'Stef',
city:'LA',
favouriteAnimal:'Bunny',
};
console.log(about);
@skudeva
Your code:
The instructions say to assign aboutMe to the object. You have assigned about. You can leave out the comma after
city: 'LA'
. Also, the convention is to use more spaces in your syntax. Below is an example:@malvoliothegood Thank you!