[javascript] JavaScript Nested function