5. What goes inside function


#1


Exercise 5

What am I supposed to put between the function parentheses?

var count = 0

var loop = function(){
	while(count < 3){
	console.log("I'm looping!")	//Your code goes here!
	count++}
};

loop();


#2

Nothing since you didnt pass arguments... but if i pass arguments i need to put something.. example:

function add(var x, var y){
 return x + y;
}

add(1,3)

More importantly, do ou undaerstand?


#3

That won't work, you can't have var here

needs to be
function add(x,y){


#4

yeah i forgot when you know a bunch of langauges hard to keep track... plus in C++ you do it that way:

template<class T>
int add(T s1, Ts2){
 return s1 + s2
}