Well, you can do such things, but don’t know what you are looking for:
<!DOCTYPE html> <html> <body> <script type="text/javascript"> Persona = { "numberOfLegs" : 2 }; Cesar = { "basics" : Persona, "name" : "Julio Cayo Cesar" } document.write( "<br>" + Cesar.name ); document.write( "<br>" + Cesar.basics.numberOfLegs ); </script> </body> </html>
If you are looking for inheritance then the answer will definitely not be. The only way to do something like this is to use $.extend( dest, org ) with jQuery.
Hope this helps.
Baltasarq
source share