In order to declare a Javascript object inside another one you would need to enter code similar to what is below.
var book = {
title: 'Nothing new!',
author: {name: 'Annyce', email:'annyce@gmail.com'}
};
You could then reference the author’s name via:
book.author.name
and if you wanted to update the name of the author, you would use
book.author.name = ‘Sarah’;
This feature of Javascript becomes very useful when you attempt to create an object with default settings and so forth.