In JavaScript, I want to mark object A as special, so that when A is accessed by B, B can check whether A is marked so that B treats A as different from other objects. (Think that B is a serializer that processes many different objects, and A has to be serialized in a certain way.)
Now, I can either
1: set a property in A, e.g., A.special=true
2: define a method, e.g., A.isSpecial(), which if the method exists, it shows that A is special.
I know that both of these do the same thing. From the design point of view, are there any differences, which makes one preferable?