A JS implementation of quick_check