create switch js