What am I missing? What is wrong with my coding in Javascript?


#1

I am on Lesson 4 (Parameters II) The Functions I have done and passed all the instructions in the lesson 4, but I am unable to get the result printed on the screen It is showing error.


#2

Oh sorry! I had missed the + before topping.:joy:


#3

Hi @muhammadtalal,

Great that you manage to debug your own code! :smiley:


One thing to mention, you will notice when you run the code, your console.log would print weirdly without extra spaces, like:

Order:thin crustpizza topped withGreen
Order:medium crustpizza topped withBacon
Order:pan crustpizza topped withSausage

Just add some spaces into your console.log:

console.log('Order: ' + crustType + ' pizza topped with ' + topping);

Add a space after “Order:” word, before “pizza” and after "with.

Then your console would print fine sentences.

Order: medium crust pizza topped with Bacon

:slight_smile:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.