Calling Javascript function on Click

Hi, I am trying to use javascript to log a click event but I can’t seem to make it happen no matter what I try. I am an absolute beginner and I’m sure I am (obviously) doing something wrong here. Can anybody lead me in the right direction? Thanks in advance.

Here is what I have
It results in the initial ‘handled1’ being logged but not the function with ‘handled2’.

Though the button does respond visually to a click, the function isn’t executed.

<App>
<JavaScript>
    console.log("Handled1");
	
	function f1(){
        console.log("Handled2");
	}
</JavaScript>

<StackPanel>
	<Button Text="Click Me" Clicked="{f1}" />
</StackPanel>
</App>
module.exports = {
	f1: f1
}

That done the trick thank you! I should have known as {f1} is in the same shortcode format which I had noticed but this solution never came to mind. Thanks again.

Is there a way to call the same function with different arguments depending on where you click? For example, I have two boxes, can I call a function with argument X for the first box and argument Y for the second one?

@Horchata: yes and no. The arguments are implicitly the data context you are clicking on, so the answer depends on your particular use case.

Please explain what you are trying to do in a new forum thread, share some code to show what you have tried so far and we’ll take it from there.