I think I have tried as solutions as I am thinking but I didnât find.
I donât want to see the solution from âget a hintâ.
I want to find answers from myself and get helps from people
and thatâs include trying to understand why the code is not doing what you want.
Try to read again the challenge instructions, and the bullet points there, try to read each bullet point and find how you are satisfying it in your code.
There is a thing just at the beginning of the list, once you respect that one, you will be able to see if the rest of your logic works or not
The logic of your code is perfectly fine, except youâve not unterstood what a âreturnâ statement does.
How it should be: Your function receives an object (and some other parameters), then modifies the object with if/if-else statements, and at the end, after all those ifs/elses, it return the modified object.
But youâre returning from the function everywhere, and youâre not returning the object, but whatever is written in your return statements, like here: return object[id][prop].push(value);
Your function will return only the value that it has pushed into the array, not the whole object.
P.S. Youâve also two typos, youâve misspelled undefined and value somewhere.
Thank you very much for helping me, you was right !
I remove the return statement from if/else-if statements as told me and I correct some word that I have misspelled like: undefined and value.