How do functions work in javascript?



How do functions work in javascript?..

Answer / Amit Pant

Functions in JavaScript are blocks of reusable code that can perform specific tasks. They can accept input data (arguments), perform computations, and return output data as a result. Functions can be declared using the `function` keyword or ES6 arrow functions. For example: `function add(a, b) { return a + b; }` or `const add = (a, b) => a + b;`.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

Give an example of closure?

1 Answers  


why we calld java object orinted programming language??

1 Answers   TCS,


How do I enable javascript on google?

1 Answers  


What is Associative Array? How do we use it?

1 Answers  


What is the Use of true or false in Ajax cal using Java Script?

3 Answers   CTS,


How to reload the current page?

1 Answers  


Is there any class in javascript?

1 Answers  


How onclick works in javascript?

1 Answers  


What is difference between java and javascript?

1 Answers  


Why is object naming important to use in javascript?

1 Answers  


Why is javascript called richer interface?

1 Answers  


What are the advantages of using external javascript?

1 Answers  


Categories