Duck-like typing things for javascript