how to connect terminal with javascript 1

how to connect terminal with javascript

// Simple Addition Function in Javascript
function add(a, b) {
return a+b
}
console.log(add(4, 6))

Here is what the above code is Doing:
1. We define a function called add that takes two parameters, a and b.
2. We return the sum of a and b.
3. We call the function add and pass in the numbers 4 and 6.
4. The function returns 10, which is logged to the console.

Similar Posts