nested object traversing

- updated the variable definition before using the var
- create a new JS file to traverse nested objects