91-9990449935 0120-4256464 |
JavaScript FunctionsJavaScript functions are used to perform operations. We can call JavaScript function many times to reuse the code. Advantage of JavaScript functionThere are mainly two advantages of JavaScript functions.
JavaScript Function SyntaxThe syntax of declaring function is given below. JavaScript Functions can have 0 or more arguments. JavaScript Function ExampleLet’s see the simple example of function in JavaScript that does not has arguments. Test it NowOutput of the above exampleFunction ArgumentsWe can call function by passing arguments. Let’s see the example of function that has one argument. Test it NowOutput of the above exampleFunction with Return ValueWe can call function that returns a value and use it in our program. Let’s see the example of function that returns value. Test it NowOutput of the above example
Next TopicJavascript Objects
|