Can't get my function to work in the playground


#1

Apologies in advance if this is in the wrong category.

I can’t get functions to work in the playground area.
It doesn’t seem to accept a variable defined with () => {} as a function.
I can’t tell if I just don’t understand how it works or if it’s broken.


I don’t understand the syntax I’m supposed to use. Please help


#2

You’re right – that is a problem! To run your function, you need to use a function call which is the name of your function with parentheses after it, like this: myFunction() But the playground isn’t creating that button, it only creates the identifier for your function, myFunction, without the parentheses.

I’ve made a report of this issue, and hopefully we can fix it soon!

–Frankie


#3

Thanks for responding.
I’m glad I could help :grin:


#4

Again — thanks for flagging this issue!

In the meantime, if you’d like to test your own functions we have created another playground using the platform jsfiddle.net. You can edit the javascript in the bottom left box to create your own function.

—Heather