Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript get x,y point on circle 
Javascript :: display toastr warning 
Javascript :: javascript express server 
Javascript :: node redirection 
Javascript :: hover jquery 
Javascript :: datetime to date in js 
Javascript :: js is number 
Javascript :: how to find length of string in javascript without using length method 
Javascript :: jquery get document scrolltop 
Javascript :: redirecting to a different route if user is logged in 
Javascript :: dummy json data 
Javascript :: remove all spaces from string javascript 
Javascript :: JavaScript - How to get the extension of a filename 
Javascript :: add color to console 
Javascript :: store array in localstorage 
Javascript :: ng build staging 
Javascript :: number format in javascript 
Javascript :: javascript compare two objects 
Javascript :: check element exist in jquery 
Javascript :: get nearby store by latitude and longitude from my latitude and long node js 
Javascript :: javascript check if text is overflowing 
Javascript :: javascript last element in array 
Javascript :: js check proccess alive 
Javascript :: react native how to delete android build 
Javascript :: js test if string 
Javascript :: browser javascript update url without changing history 
Javascript :: react native text input number only 
Javascript :: size of call stack js 
Javascript :: split string on multiple characters javascript 
Javascript :: jest-environment-jsdom cannot be found 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =