You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
used to set a default parameter inside a function definition, which goes hand in hand with the defensive coding approach, while requiring almost no effort to implement.
*/
console.log("--------1-------");
function result(number = 10, Sem = "Graduated") {
console.log("Result:", number * number, Sem);
}
result(); // take default parameters
result(20);
result(30, "Sem-3");
console.log("--------2-------");
class Student {
constructor(num1 = 999, name = "Anonymous:", bool1 = true) {