21.
What is the syntax for defining a function in JavaScript?
var function() { }
function myFunction() { }
function = myFunction() { }
myFunction { }
Correct: B
In JavaScript, you define a function using the function keyword, followed by the function name and parentheses, along with the function body enclosed in curly braces.