Write brief note on Scope in JavaScript and insert two examples: the 'wrong' and 'right' way to handle loops inside a closure.