I have this two arrays
var refArray = [\'India\',\'Pakistan\',\'Nepal\',\'Bhutan\',\'SreeLanka\',\'Singapore\',\'Thailand\',\'China\',\'Russia\'] var beenThere
Try to use indexOf:
beenThere.sort(function(a, b) { return refArray.indexOf(a) - refArray.indexOf(b); }); // ['India','Bhutan','Russia']