Question: / * * This should build a sentence and display it in the main browser window. * / var myStr = ' ' ; first

/** This should build a sentence and display it in the main browser window. */
var myStr ='';
first_part = 'I like to eat';
function GetSentence(){
console.log('starting function');
myStr = first_part;
console.log('so far so good');
for (var i =0; i <3; i++){
var x =['apples', "bananas", 'cookies'];
myStr = myStr +''+ x[i]+'';
$('body')
.find('h1')
.text(myStr);
console.log(myStr);
}
}
GetSentence();
what is the output of the program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!