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.
Which section of the IRDA Act delas with the constitution of the Insurance Regulatory and Development Authority Fund?
According to Code 36 of the Occupational Safety, Health and Working Conditions Code, 2020, can oral evidence be used to contradict standing orders cert...
Which of the following foilowing section of Indian Partnership Act, 1932 is related with the expulsion of a partner ?
Under Section 4(1) of the Consumer Protection Act, 2019, how often is the Central Council required to meet?
In a cognizable offence under IPC, the police will have all the powers to
In a negligence claim, the requirement that the damage caused by the defendant's breach of duty must not be too remote a consequence is related to______...
A company limited by guarantee means a company having the liability of its members _____________
Section 10 of the Specific Relief Act deals with____________________
Which of the following is not a ground for rejection of a complaint by Banking Ombudsman?
When is an offence under Section 138 of Negotiable Instruments Act 1881 compoundable?