"defined all the variables!" Code works, can't progress


#1

I can't get past part 11 of the "animate your name" project, been trying all sorts of things!

Somehow in the preview my bubbles turn in to squares as they should.
My code:

var red = [0, 100, 63];
var orange = [40, 100, 60];
var green = [75, 100, 40];
var blue = [196, 77, 55];
var purple = [280, 50, 60];

var Myname = "James";
var letterColors = [red, orange, green, blue, purple]
var bubbleShape = "square";

drawName(Myname, letterColors, bubbleShape);

As you can see all the variables are there, drawName contains all the variables needed to draw out some squares, letters and colours.

Thanks in advance!


#2

2 posts were split to a new topic: It's all there , but do not accept!


#3

This exercise is looking for a variable called myName, not Myname. Can you spot the difference?


#5

Thanks for your help I have changed the code to

var red = [0, 100, 63];
var orange = [40, 100, 60];
var green = [75, 100, 40];
var blue = [196, 77, 55];
var purple = [280, 50, 60];

var myName = "James";
var letterColors = [red, orange, green, blue, purple]
var bubbleShape = "square";

drawName(myName, letterColors, bubbleShape);

"Oops, try again. Make sure to only use the variables myName and letterColors in the drawName() function, like this: drawName(myName, letterColors)."

How is it possible that the code is interpreted as intended whilst I most certainly made a mistake?
I'm a bit confused becuase the bubbles actually turned into squares:P

Thanks in advance!


#6

@mrjimmoes I think that drawName() doesn't need you to call it with the additional bubbleShape parameter, it gets it automatically some other way somehow. So whether you add bubbleShape in as a third parameter or not, the bubble's shape will be what you want. But the code checker isn't expecting you to have a third parameter, so it throws an error.
Make sense?