Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

function expression and function declaration

// Function Declaration
function add(a, b) {
	return a + b;
}
console.log(add(1,2)); //3

// Function Expression
const add = function (a, b) {
	return a + b;
};

console.log(add(1,2)); //3
 
PREVIOUS NEXT
Tagged: #function #expression #function #declaration
ADD COMMENT
Topic
Name
9+7 =