Javascript problem

Today I watch javascript video Navigator object then i go to perform this and see the output the output is show undefined. please help me

share your code where you getting error