function() {
this.foo = 'bar';
const dummyFn = () => this.foo;
console.log(dummyFn());
}
function() {
this.foo = 'bar';
const dummyFn = function() { return this.foo };
console.log(dummyFn());
}
const fruitArr = ["๐", "๐", "๐", "๐", "๐"];
const getRandomElementFromArray = function (paramArr) {
const randomNumber = Math.floor(Math.random() * paramArr.length);
return fruitArr[randomNumber];
};
const randomEl = getRandomElementFromArray(fruitArr);
console.log(randomEl);