Edit in JSFiddle

var value = 'duck';
var answer;

switch (value){
  case 'camel':
    answer = '1';
    break;    
  case 'dog': 
    answer = '2';
    break;   
  case 'duck': 
    answer = '3';
    break;
}

console.log('Answer', answer);