var codes = { '909': 'Beeline', '921': 'MTS' }; var value = '909'; if (value in codes) { alert(codes[value]); }