Is there a faster way of writing this?
if ($(\'#id\').val()==7 || $(\'#id\').val()==8 || $(\'#id\').val()==9){ console.log(\'value of #id is 7, 8, or 9!\
I just added this one to the jsperf: the in operator. The value in every key:value (e.g. 7:7) pair is irrelevant here.
if ($('#id').val() in {7:7, 8:8, 9:9}) { console.log('value of #id is 7, 8, or 9!') };
see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in