Skip to main content
Version: typescript

函数

function myFunction() {
alert('hello');
}

myFunction()
// calls the function once

匿名函数

var myButton = document.querySelector('button');

myButton.onclick = function() {
alert('hello');
}