判断值是否在数组中
17282017-08-30 17:49:00返回列表
判断值是否在数组中
function getlocaleidstr(localeid){ var locale_tr_arr = [1055]; var locale_pt_arr = [1046,2070]; var locale_es_arr = [3082,1034,11274,16394,13322,9226,5130,7178,12298,17418,4106,18442,22538,2058,19466,6154,15370,10250,20490,21514,14346,8202]; if(contains(locale_tr_arr,localeid)){ return "tr"; } if(contains(locale_pt_arr,localeid)){ return "pt"; } if(contains(locale_es_arr,localeid)){ return "es"; } return "en"; } function contains(arr, str) { var i = arr.length; while (i--) { if (arr[i] === str) { return true; } } return false; } //用来判断localeid区域ID getlocaleidstr(11274);