Function literal (hay function expression) là biểu thức định nghĩa hàm không tên, gán vào biến hoặc truyền làm đối số.
Ví dụ
<html>
<head>
<script>
<!--
var func = function(x, y) { return x * y; };
function secondFunction() {
var result = func(10, 20);
document.write(result); // 200
}
//-->
</script>
</head>
<body>
<p>Nhấn nút để gọi hàm</p>
<form>
<input type="button" onclick="secondFunction()" value="Call Function">
</form>
</body>
</html>