Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to Use the Return Keyword in a Function

// return is a directive that returns a value to the function after the code within it has been executed.

function sum(a, b){
	return  a + b;
}

sum(10, 20);

//output will be 30
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #How #Use #Return #Keyword #Function
ADD COMMENT
Topic
Name
5+5 =