Given an array write a function that adds a given number to the end of the array without using the .push method.
CODE TEMPLATE
function addToEnd(arr,element){
// write your code here
}
let arr = [1,5,4,8,9];
let element = 7;
addToEnd(arr,element);
console.log(arr);