Javascript

Topic: JS Functions

What is a JavaScript Function Syntax?

A function is written as a code block (inside curly { } braces), preceded by the function keyword:function functionname(){some code to be executed}The code inside the function will be executed when "someone" calls the function.The function can be called directly when an event occurs (like when a user clicks a button), and it can be called from "anywhere" by JavaScript code.

Browse random answers: