Javascript. How to get a value from a function or get variable?

Good afternoon.
scheduler.templates.unit_date = function(date){
 var doto = scheduler.templates.day_date(date);
 doto return;

In the end, doto the same date on the current template. I need this value outside the function for further use.
As far as possible to use the value outside the function? For example, to write out the functions of the console.log(doto) and get the value.
Would that be all right? Or what are the options?
Thank you in advance!
June 5th 19 at 21:12
3 answers
June 5th 19 at 21:14
Write a class with methods needed to work with doto. To initialize the class somewhere in the code once, then work with the created object through its methods.
June 5th 19 at 21:16
Similarly, var was removed. But undefined
Expect to see the date. - jamarcus commented on June 5th 19 at 21:19
that is, you initialize a variable inside a function and want to see the value before you call this function? - Cynthia.Donnelly commented on June 5th 19 at 21:22
June 5th 19 at 21:18

Find more questions by tags JavaScript