sir in document.write after the typeof why are u adding + on both sides .And if i am not adding tag it doesnt gives output. document.write("TYPE OF X:"+typeof x+"
+ is written to concatenate string(TYPE OF X:) with typeof x then again + to concatenate tag. if you are not writing remove + sign before that you will get output.