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 consumer cases, the limitation period for filing a complaint is____________
The doctrine of ‘Full faith & credit’ is enshrined in which of the following Article of the Constitution of India?
Which of the following most accurately defines "general insurance business" as per the Insurance Act?
According to the Specific Relief Act under what circumstances can a perpetual injunction be granted?
Section 13 of CPC provides that a Foreign Judgement shall ______?
How many kinds of punishment are there under IPC?
A private person can also arrest any person who is:
As per section 4 of the Prevention of Corruption Act, notwithstanding anything contained in the Code of Criminal Procedure, 1973 the trial of an offence...
The Registration Act provides that it shall not be necessary for the _____________________to appear in person or by agent at any registration office i...
What is the restriction on commission, brokerage, discount, etc., on sale of shares as per the Banking Regulation Act?