0
I need help with my code
in my code I have this one part with a variable called x and I can't figure out how to continue adding more text after it or to add multiple variable. I'm doing this all in HTML alert ('Rules are very simple just fill in what the alert box tells you how too for example *click ok to continue*'); var x=prompt ("Type a/an Noun"); alert ('Bob has a/an '+x )};
2 Answers
+ 10
alert ('Rules are very simple just fill in what the alert box tells you how too for example *click ok to continue*');
for (var stp = 0; stp < (arr = [noun,verb,adverb]).length; stp++) {
cal(arr[stp]);
}
function cal(typ) {
var x=prompt ("Type a/an "+typ);
alert ('Bob has a/an '+x );
}
0
can u break that down for me so I can understand it better. I am new to coding. it would help a lot thx