How do you define a function in JavaScript?
What is the right output for the code below?
JavaScript
function greet ( name ) {
console . log ( ` ${ name } , Welcome to GFG!` );
}
greet ( Geek );
Which of the following is a valid arrow function?
What is a closure in JavaScript?
A function combined with its lexical scope
A function that cannot be called outside its block
A function with no arguments
A function with no return value
What is the output of the following code?
JavaScript
( function () {
console . log ( "IIFE" );
})();
Which keyword is used to refer to the current function context in JavaScript?
Which method is used to bind the 'this' context of a function explicitly?
What is recursion in JavaScript?
A function calling another function
A function calling itself
A function with no return value
A function executed immediately after declaration
What is the purpose of the rest parameter (...args) in a function?
To pass unlimited arguments as an array
To stop the function execution
To return the first argument only
What will the following code output?
JavaScript
const add = ( a , b ) => a + b ;
console . log ( add ( 5 ));
Ready to go from coding beginner to development pro? Our DSA to Development Coding Guide has everything you need to crush coding interviews and ace real-world projects! Limited spots available!Enroll Now and Transform Your Coding Skills! Also get 90% fee refund on completing 90% of the course in 90 days ! Take the Three 90 Challenge today.
There are 10 questions to complete.
Take a part in the ongoing discussion View All Discussion