Ask coding questions

← Back to all posts
1
JS Assignment 11 #2
QuinzaeBeard (0)

function exerciseTwo(animal){
// Exercise Two: In this exercise you will be given an object called 'animal'
// Create a new variable called 'animalName'
// Accessing the animal object, assign the 'animalName' variable to the 'latinName' key on the object.
// return the animalName variable.
animal.latinName= animalName;
return animalName();
}

Answered by vedprad1 (456) [earned 5 cycles]
View Answer
Commentshotnewtop
1
vedprad1 (456)

I think this should be the final answer:

function exerciseTwo(animal) {
  var animalName;
  animalName = animal.latinName;
  return animalName;
}

If this answer is correct, please check the checkmark on the left side of this message. Thanks and Good Luck!

1
QuinzaeBeard (0)

@vedprad1 i completely agree but the repl.it system disagrees lol

1
vedprad1 (456)

@QuinzaeBeard : Can you share the link to your code? Thanks!

1
vedprad1 (456)

@QuinzaeBeard : You said return animalName()! With parentheses! But it is a variable, not a function. There should be no parentheses.

If this is right, select the first post as correct. It would be greatly appreciated.

1
QuinzaeBeard (0)

@vedprad1 such a simple mistake lol...thanks so much

1
CeciliaOrji (0)

@QuinzaeBeard can you help with the answer to exerciseone, been at it since yesterday. JS question 11. Thanks

1
vedprad1 (456)

You're so close! You accidentally switched animal.latinName and animalName.
Line 6 should be animalName = animal.latinName.

If this answer is correct, please check the checkmark on the left side of this message. Thanks and Good Luck!

1
QuinzaeBeard (0)

@vedprad1 That was actually my first answer, but I kept receiving error messages