Parameters II


#1


https://www.codecademy.com/courses/learn-javascript/lessons/functions/exercises/parameters-ii?action=lesson_resume


states

"Did you call the takeOrder function with two strings within its parentheses, separated by commas?"
with the examples and hints given, it looks like it is correct but I cannot figure out what i'm doing wrong.

function takeOrder(topping, crustType) {
  console.log('Order: ' + crustType + ' topped with ' + topping);
}

takeOrder(' Green Peppers ' , ' Thin Crust ');
takeOrder(' Bacon' , ' Medium Crust');
takeOrder(' Sausage ' , ' Pan Crust');


#2

Try removing the white space from your inputs.

'Green Peppers'

and so on. The SCT must be seeing double spaces when it expects single.


#3

MTF, you were dead on, it was the white space. Thank you for help.

Thank You,
Javier Rivera


#5

https://www.codecademy.com/courses/learn-javascript/lessons/functions/exercises/return

var orderCount = 0;

function takeOrder(topping, crustType) {
console.log('Order:' + crustType + ' pizza topped with ' + topping);
orderCount = orderCount + 1 ;
}
function getSubTotal (orderCount){
return orderCount * 7.5;
}

takeOrder('bacon', 'thin crust');
takeOrder('Sausage', 'thick crust');
takeOrder('onions','deep dish');
getSubTotal(ordercount);

I' m on step 5 and can't seem to figure out where I am going wrong


#6

Try adding a space character after :.


#7

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