# JS Functions

A set of code that you can use over again, rather than writing it out multiple times.

<mark>Syntax :</mark>

```javascript

function functionname (arguments- its optional){
    // code
}
```

<mark>Example:</mark>

```javascript
function number(moon, start){
 console.log(moon + start)
}

number(55, 100)

// here terminal
155
```

<mark>Example:</mark>

```javascript
function eletricals(tv, mobile){
    let total = tv + mobile;
    console.log(total);
}

eletricals(22, 89)


// here terminal 
111
```

<mark>Example:</mark>

```javascript
function fruits ( apple, banana){
    let vegi = apple + banana;
    return  vegi; // through the value
}

let nuts = fruits (80, 24)//catch the value
console.log(nuts);//print the value

// here terminal
104
```
