DEV Community

Saravanan Cn
Saravanan Cn

Posted on

Day 10: Learning JavaScript Parameters, Arguments & If-Else Conditions 🚀

Today is Day10 of my web development learning journey. I contonued learning javascript and leraned about function,parameters,arguments and if-else condition.

1. Function Parameters


function greet(name) {
console.log("Hello " + name);
}

2. Function Arguments

Arguments are the actual values that we pass to a function when we call it.
greet("Saravanan");

3.If-else condition

The if block runs when the condition is true.

If the condition is false, the else block runs.

`let age = 20;

if (age >= 18) {
console.log("Eligible");
} else {
console.log("Not eligible");
}`

Top comments (0)