JavaScript Functions
JavaScript Functions - Important Points
6. | What is the syntax to declare a JavaScript function? |
---|
A. function myFunction() {}
B. let myFunction = function() {}
C. myFunction = function() {}
D. let myFunction() {}
View Answer Discuss Work SpaceAnswer: option a
Explanation:
7. | Which keyword is used to return a value from a JavaScript function? |
---|
A. return
B. break
C. continue
D. yield
View Answer Discuss Work SpaceAnswer: option a
Explanation:
8. | Which of the following is not a valid JavaScript function parameter passing method? |
---|
A. Pass by value
B. Pass by reference
C. Pass by pointer
D. Pass by object
View Answer Discuss Work SpaceAnswer: option c
Explanation:
9. | What is the purpose of the "arguments" object in a JavaScript function? |
---|
A. To store the function name
B. To store the function code
C. To store the function parameters
D. To store the function return value
View Answer Discuss Work SpaceAnswer: option c
Explanation:
10. | Which of the following is a built-in JavaScript function? |
---|
A. prompt()
B. alert()
C. console.log()
D. All of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation: