so what do i do here? is it to call the function??
You can try answering this question and fixing the problem I pointed out…
Do you understand what I meant when I said that you added an extra function argument?
Can you explain why you added that extra argument?
Do you understand what the function I’m trying to get you to write is supposed to do?
yes i understood your question.why i added the two arguments that does not exist on the code.i was thinking the return keyword will return them as value
But a function argument is an input. It is information that goes into the function. How can you pass the newFilmObject into a function that makes the newFilmObject? It doesn’t exist until after the function that makes it runs so you can’t possibly pass it into the function that makes it.
that was ignorant of me
The challenge really has two parts
-
make a function to convert the old objects in the array into the new format
-
use this function inside of a map to make an array of new objects
So one way or another you need make this function
What you have here is close ish, but incomplete
function filmCallback(oldFilmObject) {
let newFilmObject = {title: title, imdb: rating};
// to do....
return newFilmObject;
}
Where do the title and rating come from?
they came from watchList array
How? Where? Currently nothing is creating those variables.
Have you done this challenge:
yes i have done the challenge.accessing object property with dot notation
So… How do you get the values you need out of the old object so you can make the new object?
through bracket notation i can get it
Ok. Show me how.
const user = {};
user1[‘firstname’] = ‘justice’;
user1[‘lastname’] = ‘columbus’;
console.log(user1.firstname);
// output: justice
That appears to be unrelated to the film object. Can you do this with the film objects?
const watchList = {};
watchList[‘title’] = ‘title’;
watchList[‘imdb’] = ‘rating’;
console.log(watchList.title);
// output: title
But watchList is an array…
should it had been ratings??
Are you trying things and trying to fix them when they don’t work? It seems like are you trying to put up incomplete code and have me do all the fixing and debugging for you.
no i am not. even while i am answering your questions iam still trying on my own and googling,just to see if i can debug the code
Your answers aren’t really making any sense, so I don’t think my approach is working for you at all. Maybe someone else can help in a way that you understand better.