Tuesday, August 19, 2014

Previous Interview Question Next Interview Question
Home

when the function below is finished executing,which of the following indicates what the arraycats[] contains?

function converter()
{
var i,cats=new Array();
cats[0]='Jaguar';
cats[1]='cougar';
cats[2]='puma';
cats[3]='panther';
for(i in cats){
switch(i)
{
case 'puma';
i='Lynx';
break;
case 'Lynx';
i='pinto';
break;
default:
i='stringray';
   }
  }
 }
         a)      ‘Jaguar’,’Cougar’,’Puma’,’Panther’ 
         b)      ‘stringray’,’stringray’,’Lynx’,’Panther’
         c)       ‘stringray’,’stringray’,’Pinto’,’Panther’
         d)      ‘Jaguar’,’Cougar’,’Lynx’,’Panther’
         e)      ‘Jaguar’,’Cougar’,’Pinto’,’Panther’


Answer :  A

Previous Interview Question Next Interview Question
Home

0 comments :

Post a Comment