How to set default values in graph component that can be changed by students?

Hi all, I’m working on an activity that involeves students changing parameters of various functions, for example f(x) = x^n with n as a student input from a Math Input component. The problem is that I’d like the students to be able to see the changes they do in real time while typing the parameter in the math input box, and also having a default starting function (e.g. f(x) = x^2 ) displayed on the screen at the beginning of the activity. How could I achieve this? I imagine writing something in the graph component like

number(“n”): when parameter.numericValue “not defined”
2
otherwise parameter.numericValue

where the “not defined” pseudo code would mean that the user has not yet typed anything in the math input named “parameter”.

Thanks for your help!

You just needed to use the function isUndefined() around parameter.numericValue and then you were good. The link above has the screen