mirror of https://github.com/sveltejs/svelte
16 lines
337 B
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>
|