Articles → JavaScript → Anonymous Function In Javascript

Anonymous Function In Javascript






Purpose





Example


<html><head><title>Anonymous function demo</title><script>
	//  Assigning function to a variable
	var anony = function(a, b) {
		alert(a + b);
	};
	// Calling variable as function    
	anony(4, 3);
	</script></head><body></body></html>



Output


Picture showing the output of anonymous function in javascript



Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, May 27, 2020

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250