1.
What is the primary purpose of JavaScript functions?
2.
Which of the following correctly defines a JavaScript function?
3.
What is the purpose of parameters in a JavaScript function?
4.
Which type of JavaScript function is defined without a name?
5.
Consider the following JavaScript code: let greet = function(name) { return 'Hello, ' + name + '!'; }; What type of function is greet in this code?
6.
What is the purpose of an event in JavaScript?
7.
Which method is used to attach an event listener to an HTML element in JavaScript?
8.
How can you prevent the default behavior of an event in JavaScript?
9.
What is the purpose of the onclick attribute in HTML elements?
10.
Which event is triggered when a user clicks on an HTML element?