Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

svelte pass arguments to function

<script>
  const function_with_parameter = parameter => () => {
  	console.log(`The passed parameter was: ${parameter}`)
  } 
</script>
<body>
  <button on:click="{function_with_parameter('foo')}">
</body>
Source by svelte.dev #
 
PREVIOUS NEXT
Tagged: #svelte #pass #arguments #function
ADD COMMENT
Topic
Name
4+4 =