javascript - Creating variable array for keycode -


i trying create single variable contains of function key codes. if remove brackets , use single keycode works.

$('input').keyup(function (e) {      var functionkeyspressed = e.which == [114, 115, 116, etc];      if (!functionkeyspressed) {      }  }); 

use indexof()

$('input').keyup(function (e) {      var functionkeyspressed = [114, 115, 116, etc].indexof(e.which) > -1;      if (!functionkeyspressed) {      }  }); 

Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

php - Improving script execution time -

How to provide Authorization & Authentication using Asp.net, C#? -