JavaScript duck typing tool