Example and explanation of JavaScript namespaces tree.
The following namespaces need to be defined in JavaScript:
root
root.person
root.home
root.home.relative
My attempt that was incorrect:
var root='';
root.person='';
root.home='';
root.home.relative='';
Please provide an explanation for your code as I am not very familiar with JavaScript compared to PHP or Java.
Thank you!