//Use this file to implement Part One of your project

// console.log("test")

var animal = {}

animal.username = "Daffy";

// console.log(animal['username']);

animal["tagline"] = "Ducks Rule!";

var empty = [];
animal.noises = empty;

console.log(animal);

var i = 0
for(var key in animal){
	i++;
	console.log(i);
	// console.log(animal[key]);
	if (key === "username")
		console.log("Hi, I my name is " + animal[key]);
	else if (key === "tagline")
		console.log(animal[key]);
};

// part 2 Array exercise===========================

var noiseArray = [];

noiseArray.unshift("quack");
noiseArray.push("Woof")
noiseArray[noiseArray.length] = ("neow")

// console.log(noiseArray.length);
// console.log(noiseArray[2]);

animal.noises = noiseArray;
// console.log(animal);

var quackers = { username: 'DaffyDuck', tagline: 'Yippeee!', noises: ['quack', 'honk', 'sneeze', 'growl'] }
var squirrel = { username: 'Bob', tagline: 'Nuts for nuts!', noises: ['chirp', 'screech'] }
var cow = { username: 'Milkmaid', tagline: 'Dairy for Life', noises: ['moo', 'moo moo', 'moooooo'] }

animals = [];

animals.push(animal, quackers, squirrel, cow);

console.log("Part 2- Arrays ===================================")
console.log(animals);
console.log(animals.length);

// part 3 Function exercise=====================================

var AnimalTestUser = function(username){
	var otherArgs = [];
	var args = arguments.length;
	if (args > 1) {
		for(var i=0; i<args; i++){
			if (i > 0){
			otherArgs.push(arguments[i]);
				}
			}
	}
	return { username: username,
		otherArgs
	}
}




console.log("Part 3- Functions ===================================")
console.log(AnimalTestUser("Bob", "duck", "cat"));



@@ -1566,127 +1566,612 @@
 %0A%7D%0A%0A
-%0A%0A%0Aconsole.log(%22Part 3- Functions ===================================%22)%0Aconsole.log(AnimalTestUser(%22Bob%22, %22duck%22, %22cat%22
+var addFriend = function(animalFriends)%7B%0A%09// var friends = %5B%5D%0A%09return friends = animalFriends%0A%7D%0A%0Avar AnimalCreator = function(info)%7B%0A%09for(var i=0; i%3Carguments.length; i++)%7B%0A%09%09username = arguments%5B0%5D;%0A%09%09species = arguments%5B1%5D;%0A%09%09tagline = arguments%5B2%5D;%0A%09%09noises = arguments%5B3%5D;%0A%09%09addFriend(arguments%5B4%5D);%0A%09%7D%0A%09return %7B username, species, tagline, noises, friends%7D%0A%7D%0A%0A%0A%0A%0Aconsole.log(%22Part 3- Functions ===================================%22)%0Aconsole.log(AnimalTestUser(%22Bob%22, %22duck%22, %22cat%22));%0Aconsole.log(AnimalCreator(%22Bob%22, %22duck%22, 'You can count on me!', %5B'baahhh', 'arrgg', 'chewchewchew'%5D, %5B'bat', 'cow'%5D
 ));%0A

Add parameters to animalCreator function, and make addFriend function.