What is functions in javascript?

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours scrolling social media and waste money on things we forget, but won’t spend 30 minutes a day earning certifications that can change our lives.
Master in DevOps, SRE, DevSecOps & MLOps by DevOps School!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

A function is a set of statements that take inputs, do some specific computation, and produce output. The idea is to put some commonly or repeatedly done tasks together and make a function so that instead of writing the same code again and again for different inputs

Syntax

function functionName(Parameter1, Parameter2, ..)
{
    // Function body
}

example

<!DOCTYPE html>
<html>
<head>
		<title> alert in javascript</title>
</head>
<body>
		<script>
		function f1()
		{
		document.write("this is function");
		document.write("<br>");
		document.write("in javascript");
		
		}
		function f2()
		{
		document.write("using multiple ");
		document.write("function");
		}
		
		f1();
		document.write("<br>");
		f2();
		</script>

</body>
</html>

output

this is function
in javascript
using multiple function

Related Posts

Uncovering Chennai: A Traveler and Local Perspective on City Life, Events and Landmarks

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

Modernizing Tech Stacks for Scalable Gaming Enterprises

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

Essential Qualities and Competencies to Look for in a DevOps Instructor

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

Exploring Your Backyard: Finding Local Goods, Shops, and Services

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

Finding Your Way Through Oncology Care: A Patient and Family Roadmap

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More

Finding Excellence in Neurological Care: Selecting a Specialized Neurosurgery Facility

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps! We spend hours scrolling social media and waste money on things we forget, but won’t spend 30…

Read More
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x