Start learning 50% faster. Sign in now
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.
What is the maximum number of directors a company can appoint without passing a special resolution?
Which of the following is NOT a general exception under chapter 4 of IPC?
According to the Companies Act, 2013 what should be the minimum paid-up capital of a public limited company?
If any loss is caused to the beneficial owner due to the negligence of the depository or the participant.
Under the Arbitration and Conciliation Act, 1996, who has the authority to appoint an arbitrator when the parties fail to do so?
What is the maximum duration of a wage period under the Payment of Wages Act, 1936?
What is the minimum paid-up capital required for a private company under the Companies Act, 2013?
What is the primary objective of the Minimum Wages Act?
An internal aid that may be added to include something within a Section or to exclude something from it is known as ___________.
As per the Legal Services Authority Act the term case means______________