Answer the question
In order to leave comments, you need to log in
How to get an object from a function?
There is a function that, through prompt, asks the user for data, simultaneously writing them to the object. The function itself is called by clicking on the button. Question: is it possible to pull out a ready object without calling a function separately from addEventListener;
The code itself
Answer the question
In order to leave comments, you need to log in
An example of a code and a task to be solved is desirable.
If you almost blindly give an answer, then you can make an object outside the function. This will make it possible to get the last data written to the object, without calling a function.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question