I have always learned that to declare a function in javascript you should do something like:
function myfunction(fruit){
alert(\'I like \' + fruit + \'!\');
const
let
MDN references:
Note: if I remember correctly, let and const are not interpreted correctly by all browsers.