DEV Community

Discussion on: JavaScript beginner help

 
roxor profile image
roxor

Understood, in case if u want to call in another function day.getFullYear must make new, cuz this is work only in block of function birth, right?

Thank you for advice, I must try do give more descriptive names for var.

Thread Thread
 
alvaromontoro profile image
Alvaro Montoro

The variables will only work in the function/block where they were defined. So if you want to use it somewhere else, you'll need to redefine it or make it global.

Thread Thread
 
roxor profile image
roxor • Edited

I get it, thank you for the explanation you help me a lot.
When I get a job, from my first paycheck I will buy you a coffee.

thank you one more time. Cheers!