Function Declaration

noun

say it: “FUNGK-shun dek-luh-RAY-shun” /ˈfʌŋkʃən ˌdɛkləˈreɪʃən/

Creating a named JavaScript function with the function keyword.

What is Function Declaration in JavaScript?

Function Declaration — A named function created with the function keyword as a statement.

function total(price, quantity) {
    return price * quantity;
}

In a sentence

  • “The function declaration function addTax(price) { ... } can be called from anywhere in the file.”

Level: Apprentice · More JavaScript terms at this level

Updated