Question:What will produce output for the following JavaScript code?
function greeting(a,n){

 for(i=0;i<n;i++){
  if(a=="m")return "morning "
  if(a=="e")return "evening "
 }
}
document.write(greeting("m",3));
 

A morning 

B morning morning morning 

C morning morning 

D morning evening 

+ Answer
+ Report
Total Preview: 876

Copyright © 2024. Powered by Intellect Software Ltd