Use `toString` check rather than `instanceof` check.