VK said:
Because the last line has no sense.
That is the sort of statement that explains why Usenet quoting
conventions are as they are.
Besides 'instanceof' and 'object' are reserved (but not
implemented yet) words in JavaScript, you have to quote
them (or better not use at all).
The Instanceof operator was implemented in JavaScript 1.4 and JScript
5.0 and is specified in ECMA 262 3rd edition (section 11.8.6):-
<quote>
11.8.6 The instanceof operator
The production RelationalExpression: RelationalExpression
instanceof ShiftExpression is evaluated as follows:
1. Evaluate RelationalExpression.
2. Call GetValue(Result(1)).
3. Evaluate ShiftExpression.
4. Call GetValue(Result(3)).
5. If Result(4) is not an object, throw a TypeError exception.
6. If Result(4) does not have a [[HasInstance]] method, throw
a TypeError exception.
7. Call the [[HasInstance]] method of Result(4) with parameter
Result(2).
8. Return Result(7).
</quote>
The identifier - Object - (initial capital) is a reference to the global
Object constructor and will be resolved without error in all ECMA Script
implementations.
The expression - d instanceof Object - is valid in all recent ECMA
Script implementations and should return a boolean value. The OP may be
suffering from another instance of the built in objects (such as Date)
not quite complying with the ECMA specs in JScript.
What output are you trying to get?
<snip>
The expression provided as the document.write parameter should resolve
to the strings "true<br>" or "false<br>".
Richard.