Ad
  • Custom User Avatar

    This is interesting but only works if you declare years using the var keyword in the loop definiton, which is not desirable these days. The value of years can be accessed outside of the loop because of the "var". If you use "let" which is the best practice AFAIK, years is undefined outside of the loop.