You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/function-hoisting/main.svelte

16 lines
337 B

<script>
export let greeting = 'Hello'
let name = 'world';
// both functions, and `name` are hoistable, but hoistMe does not get hoisted
function hoistMeMaybe () {
return hoistMe(name) // comment out this line => hoistMe is hoisted
}
function hoistMe (name) {
return name
}
</script>
<h1>{greeting}, {hoistMeMaybe()}</h1>