Is it possible to add a function's argument to a newly created empty array?

is it possible to add a function’s argument to a newly created empty array?
would you create the empty array first within the function and use array.push(with fuctions argument here?) ?? how would you do it?

I found this would answer your questions:

Hope it helps!

thanks i’m the record collection question, i didn’t want to look at the solution and try to do it myself first. just trying to put value which is the function argument into a array. I pretty sure i have to assign it to property first just not sure how, thanks smh been staring at this problem for 4 hours now hahaha passed the first test rest of them are all fail

you can assign a value to an object property in the same way you assign to a variable, with =

1 Like

i know, the question is asking to create an empty array and assign value to it (value is one of the argument within the function) thats the part i’m confused about like how would that work?

you need to put value inside the array, not assign to the empty array

the end result should be that the object property is assigned an array that contains value