Refactored to eliminate jsHint errors for strict programming:
Eg:
- added semicolons where missed
- modified the var names to use CamelCase
- modified if statements to add === instead of ==
- added verification in for (key in object)  statement to check for hasOwnProperty
- added indentation to entire code of 4 spaces