Yes, thatβs enough. Note: Stringmay also accept properties that you do not check:
var a = new String("hello");
a.foo = "bar";
But since String instanceof Object == trueyou should be fine.
For fun, try this (it works since /x/ instanceof Object == true):
var x = /hello/;
x.foo = "bar";
: instanceof , , , , javascript function Object, (function() { })() Object, .
, .
-tjw