function miFuncion(){
	var x = Math.PI;
	var y = Math.sqrt(16);
	var numeroEntre15Y100 = (Math.random() * 85) + 15;
	console.log(x);
	console.log(y);
	console.log(numeroEntre15Y100);
}

/**
* Concat three arrays
*/
function myConcat(){
	var parents = ["Jani", "Tove"];
	var brothers = ["Stale", "Kai Jim", "Borge"];
	var children = ["Cecilie", "Lone"];
	var family = parents.concat(brothers, children);
	console.log(family);
}

/**
* Convert an array to string
*/
function myToString(){
	var fruits = ["Banana", "Orange", "Apple", "Mango"];
	console.log(fruits.toString());
}

/**
* Sort the array alphabetically
*/
function mySort(){
	var fruits = ["Banana", "Orange", "Apple", "Mango"];
	console.log(fruits.sort());
}

/**
* Reverse the order of an array
*/ 
function myReverse(){
	var fruits = new Array("Banana", "Orange", "Apple", "Mango");
	console.log(fruits.reverse());
}

/**
* Join the array elements in a string by a separator character
*/
function myJoin(){
	var fruits = new Array("Banana", "Orange", "Apple", "Mango");
	var miJoin = fruits.join("+");
	console.log(miJoin);
}

/**
* Split a string by a separator character to an array
*/ 
function mySplit(){
	var cadena = "Banana,Orange,Apple,Mango";
	var miSplit = cadena.split(",");
	console.log(miSplit);
}

/**
* Remove the last element of an array
*/
function myPop(){
	var fruits = ["Banana", "Orange", "Apple", "Mango"];
	fruits.pop();
	console.log(fruits);
	fruits.pop();
	console.log(fruits);
	fruits.pop();
	console.log(fruits);
}

/**
* Remove the first element of an array
*/
function myShift(){
	var fruits = ["Banana", "Orange", "Apple", "Mango"];
	fruits.shift();
	console.log(fruits);
	fruits.shift();
	console.log(fruits);
	fruits.shift();
	console.log(fruits);
}

/**
* Add a new element at the beggining of an array
*/
function myUnshift(){
	var fruits = ["Banana", "Orange", "Apple", "Mango"];
	alert(fruits.unshift("Kiwi"));
	alert(fruits.unshift("Lemon","Pineapple"));
	alert(fruits);
}

/**
* Return a subarray
* array.slice(start, end)
* if end is not specified it goes to the last element
*/
function mySlice(){
	var fruits = ["Banana", "Orange", "Apple", "Mango"];
	alert(fruits.slice(0,1));
	alert(fruits.slice(1));
	alert(fruits.slice(-2));
	alert(fruits);
}

/**
* Remove elements from an array and add new elements at that position
* array.splice(start, end)
* if end is not specified it goes to the last element
*/
function mySplice(){
	var fruits = ["Banana", "Orange", "Apple", "Mango"];
	fruits.splice(2,1,"Lemon");
	console.log(fruits);
}

//http://www.w3schools.com/js/js_obj_array.asp

