Nameless functions.
// Regular function.
function hello() {
alert('Hello world!')
}
// Function assigned to a variable.
const hello = function() {
alert('Hello world!')
}
// Anonymous function.
const hello = () => {
alert('Hello world!')
}
// Regular function used as a callback.
setTimeout(hello, 1000)
// Anonymous function used as callback.
setTimeout(() => {
alert('Hello world!')
}, 1000)
Level
Topics