0

If we have a book object but we do not give it a "subtitle" property, will following code return undefined?

If we have a book object but we do not give it a "subtitle" property, will following code return undefined? bar len = book.subtitle.length;

7th Jul 2017, 1:38 AM
DIY Mods
DIY Mods - avatar
7 Answers
+ 1
Why subtitle, can you give other property?
7th Jul 2017, 2:00 AM
CalviŐ˛
CalviŐ˛ - avatar
0
it doesn't meter. You can give it any name, just wondering does it returns "undefined"
7th Jul 2017, 2:14 AM
DIY Mods
DIY Mods - avatar
0
@Jamie what value have a property that doesn't exist?
7th Jul 2017, 2:18 AM
DIY Mods
DIY Mods - avatar
0
@Jamie If we theoretically have an object and this object doesn't have a "subtitle" property, will "bar len = book.subtitle" return undefined?
7th Jul 2017, 2:30 AM
DIY Mods
DIY Mods - avatar