Question
Which ES6 feature allows for function parameters to have
default values if no value is provided during a function call?Solution
Default parameters in ES6 enable a function to use a default value for a parameter if no argument is passed. This enhances code readability and reduces the need for conditional checks. Example: function greet(name = "Guest") { Â return `Hello, ${name}!`; } console.log(greet());Â Â Â Â Â Â // Outputs: Hello, Guest! console.log(greet("Alice"));Â Â // Outputs: Hello, Alice! This feature is especially useful in scenarios where optional parameters are involved, as it simplifies function declarations. ________________________________________ Why Other Options Are Incorrect: 1. Arrow functions: Arrow functions are a concise syntax for writing functions but do not relate to parameter defaults. 2. Template literals: Template literals allow embedding expressions in strings using backticks, unrelated to parameter handling. 3. Rest parameters: Rest parameters gather multiple arguments into an array, enabling flexible argument handling but do not assign defaults. 4. Destructuring assignment: Destructuring allows unpacking values from arrays or objects but does not deal with function defaults.
In 2021, which two states in India had the lowest forest cover with respect to their total geographical area?
Under which of the following Acts, Christian missionaries were allowed to preach religion in India?
Which ministry has launched the Swachh Survekshan Grameen (SSG) 2025?
Thangka paintings are primarily associated with which religion?
In which country will the largest statue of Dr. BR Ambedkar be unveiled outside India?
Match the following:
Â
Where did the Asian Weightlifting Championships 2023 take place?Â
Which of the following led to the introduction of English Education in India?
1. Charter Act of 1813
2. General Committee of Public In...
The Blue Transformation strategy by FAO focuses on which sector?
 India’s first writer’s village has been inaugurated in which of the following cities?